Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

LotSerMst table sets cost to zero during a Bin to Bin, 1 step transfer


Symptoms

You notice that the cost sets to zero in the LotSerMst table after you do a 1-step transfer, bin to bin.

↑ Back to the top


Resolution

Apply trigger to database:

create trigger xLotSerMstCost on LotSerMst for insert as
set nocount on
if (select COUNT(*) from inserted where Cost=0)>0
begin
update L set L.Cost=(select MAX(m.cost) from LotSerMst m with (nolock) inner join inserted i on m.Invtid = i.invtid and m.LotSerNbr=i.LotSerNbr)
  from LotSerMst L
   inner join inserted i on L.InvtID=i.InvtID and L.LotSerNbr=i.LotSerNbr and L.SiteID=i.SiteID and L.WhseLoc=i.WhseLoc
   inner join Inventory invt with (nolock) on i.InvtID=invt.InvtID
   where i.Cost=0 and i.LotSerNbr<>'' and i.OrigQty=1 and invt.LotSerTrack='SI'
end
go

↑ Back to the top


Keywords: kbmbsmigrate, kbmbspartner, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 3034220
Revision : 2
Created on : 2/3/2017
Published on : 2/3/2017
Exists online : False
Views : 95