Compartir a través de


La tabla LotSerMst establece el costo en cero durante una bin en Bin, transferencia en un solo paso

En este artículo se proporciona una resolución para el problema por el que el costo de la tabla LotSerMst va a cero en un contenedor para la transferencia de un solo paso en Microsoft Dynamics SL.

Se aplica a: Microsoft Dynamics SL
Número de KB original: 3034220

Síntomas

Observe que el costo establece en cero en la tabla LotSerMst después de realizar una transferencia de un solo paso, bin en bin.

Solución

Aplicar desencadenador a la base de datos:

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