Quantcast
Channel: Microsoft Dynamics SL
Viewing all articles
Browse latest Browse all 7845

Forum Post: RE: Inventory (issue screen): the detail line items are missing from the screen and database

$
0
0
Here's the script. Please remember this assumes you found out the missing data from a source outside the system. Therefore, any meaningful data really is expected as a parameter on the script. As a disclaimer, this script was meant to solve a specific issue in my company. In fact, there's a lot of hard coded data that won't fit you. To run, the command is something as in sqlcmd -S -E -i add-intran.sql -v invtid=IEPCA004 batnbr=661570 line=19 q=1 ref=20170404 srclineref=00001 srcnbr=067092 srctype=POR task=Z9180 uom=PAR /************************************************************************************************** recupera-intran.sql Recupera detalle de INTran Parámetros: $invtid $batnbr $line $q $ref $srclineref $srcnbr $srctype $task $uom ***************************************************************************************************/ declare @acct char(10) declare @desc char(30) select @desc= descr, @acct=COGSAcct from inventory where invtid='$(invtid)' INSERT INTO [dbo].[INTran] ([Acct] ,[AcctDist] ,[ARDocType] ,[ARLineID] ,[ARLineRef] ,[BatNbr] ,[BMICuryID] ,[BMIEffDate] ,[BMIEstimatedCost] ,[BMIExtCost] ,[BMIMultDiv] ,[BMIRate] ,[BMIRtTp] ,[BMITranAmt] ,[BMIUnitPrice] ,[CmmnPct] ,[CnvFact] ,[COGSAcct] ,[COGSSub] ,[CostType] ,[CpnyID] ,[Crtd_DateTime] ,[Crtd_Prog] ,[Crtd_User] ,[DrCr] ,[EstimatedCost] ,[Excpt] ,[ExtCost] ,[ExtRefNbr] ,[FiscYr] ,[FlatRateLineNbr] ,[ID] ,[InsuffQty] ,[InvtAcct] ,[InvtID] ,[InvtMult] ,[InvtSub] ,[IRProcessed] ,[JrnlType] ,[KitID] ,[KitStdQty] ,[LayerType] ,[LineID] ,[LineNbr] ,[LineRef] ,[LotSerCntr] ,[LUpd_DateTime] ,[LUpd_Prog] ,[LUpd_User] ,[NoteID] ,[OrigBatNbr] ,[OrigJrnlType] ,[OrigLineRef] ,[OrigRefNbr] ,[OvrhdAmt] ,[OvrhdFlag] ,[PC_Flag] ,[PC_ID] ,[PC_Status] ,[PerEnt] ,[PerPost] ,[PoNbr] ,[PostingOption] ,[ProjectID] ,[Qty] ,[QtyUnCosted] ,[RcptDate] ,[RcptNbr] ,[ReasonCd] ,[RefNbr] ,[Retired] ,[Rlsed] ,[S4Future01] ,[S4Future02] ,[S4Future03] ,[S4Future04] ,[S4Future05] ,[S4Future06] ,[S4Future07] ,[S4Future08] ,[S4Future09] ,[S4Future10] ,[S4Future11] ,[S4Future12] ,[ServiceCallID] ,[ShipperCpnyID] ,[ShipperID] ,[ShipperLineRef] ,[ShortQty] ,[SiteID] ,[SlsperID] ,[SpecificCostID] ,[SrcDate] ,[SrcLineRef] ,[SrcNbr] ,[SrcType] ,[StdTotalQty] ,[Sub] ,[SvcContractID] ,[SvcLineNbr] ,[TaskID] ,[ToSiteID] ,[ToWhseLoc] ,[TranAmt] ,[TranDate] ,[TranDesc] ,[TranType] ,[UnitCost] ,[UnitDesc] ,[UnitMultDiv] ,[UnitPrice] ,[User1] ,[User2] ,[User3] ,[User4] ,[User5] ,[User6] ,[User7] ,[User8] ,[UseTranCost] ,[WhseLoc]) VALUES (@acct -- Acct ,0 -- ,'' -- ,0 -- ,''-- ,'$(batnbr)' -- ,'' -- ,0 -- ,0 -- ,0 -- ,'' -- ,0 -- ,'' -- ,0 -- ,0 -- ,0 -- ,1 -- ,@acct -- ,'0000000ZZZZZZZ' -- ,'' -- ,'MPCSA' -- ,getdate() -- ,'10020' -- ,'ESTRELOW' -- ,'C' -- ,0 -- ,0 -- ,0 -- ,'' -- ,'2017' -- ,0 -- ,'' -- ,0 -- ,'110401' -- ,'$(invtid)' -- ,-1 -- ,'1CT0009ZZZZZZZ' -- ,0 -- ,'IN' -- ,'' -- ,0 -- ,'S' -- ,$(line) -- ,-32768+($(line)-1)*256 -- ,REPLACE(STR($(line),5),' ','0') -- ,0 -- ,getdate() -- ,'10020' -- ,'ESTRELOW' -- ,0 -- ,'' -- ,'' -- ,'' -- ,'' -- ,0 -- ,0 -- ,'Y' -- ,'' -- ,1 -- ,'201704' -- ,'201704' -- ,'' -- ,'' -- ,'CT0009' -- ,$(q) -- ,0 -- ,0 -- ,'' -- ,left('$(invtid)',3) -- ,'$(ref)' -- ,0 -- ,0 -- ,'' -- ,'' -- ,0 -- ,0 -- ,0 -- ,0 -- ,0 -- ,0 -- ,0 -- ,0 -- ,'' -- ,'' -- ,'' -- ,'' -- ,'' -- ,'' -- ,0 -- ,'CT0009' -- ,'' -- ,'' -- ,0 -- ,'$(srclineref)' -- ,'$(srcnbr)' -- ,'$(srctype)' -- ,0 -- ,'1CT0009ZZZZZZZ' -- ,'' -- ,0 -- ,'$(task)' -- ,'' -- ,'' -- ,'' -- ,'20170404' -- ,@desc -- ,'II' -- ,0 -- ,'$(uom)' -- ,'M' -- ,0 -- ,'' -- ,'' -- ,0 -- ,0 -- ,'' -- ,'' -- ,0 -- ,0 -- ,0 -- ,'01' -- ) GO

Viewing all articles
Browse latest Browse all 7845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>