Sunday, 26 January 2014

Part Number Auto generate using BPM in Epicor

Find ttPart where ttPart.RowMod = "A" no-error.
If Available ttPart then do :
For each Part where Part.Company = ttPart.Company and part.Shortchar01= ttPart.ShortChar01 and Part.ProdCode = ttPart.ProdCode :
if Part.Number01 = 0 then
ttPart.Number01 = 100015.
end.
end.
ttPart.PartNum = ttPart.ShortChar01 + ttPart.ProdCode + String(ttPart.Number01).


Find ttPart where ttPart.RowMod = "A" no-error.
If Available ttPart then do :
For each Part where Part.Company = ttPart.Company and part.Shortchar01= ttPart.ShortChar01 and Part.ProdCode = ttPart.ProdCode :
if Part.Number01 > 0 then
ttPart.Number01 = Part.Number01 + 1.
end.
end.
ttPart.PartNum = ttPart.ShortChar01 + ttPart.ProdCode + String(ttPart.Number01).

Query to set Single user to Multi user in Sql server

exec sp_dboption 'epicor905', 'single user', 'FALSE'

select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame from sysprocesses p inner join sysdatabases d on p.dbid = d.dbid where d.name = 'epicor905'

kill spid

ALTER DATABASE epicor905 SET MULTI_USER

Query to find last restore date and time in Sql server


Declare @DB sysname = 'EpicorPilot905'
Select * from msdb.dbo.restorehistroy where destination_database_name = @DB;