Dimension Hell

Hi all. I have a custom ledger table that also uses the Ledger Entry Dimension table. In turn, a process takes the ledger record and creates a Job Journal Line entry along with the Dimensions from the custom ledger table. This works fine. //TO108>> TempLgrDim.SETRANGE("Table ID",DATABASE::"Orphan Ledger Entry"); TempLgrDim.SETRANGE("Entry No.","Entry No."); DimMgt.CopyLedgEntryDimToJnlLineDim(TempLgrDim,TempJnlLineDim); //TO108<< Next, the Job Journal posting routine is called from this same process. I watch in the debugger and my dimensions that I passed into the posting routine are there and are properly transfered by dimension management to a new temp dimension variable. JobJnlLine.COPY(JobJnlLine2); TempJnlLineDim.RESET; TempJnlLineDim.DELETEALL; DimMgt.CopyJnlLineDimToJnlLineDim(TempJnlLineDim2,TempJnlLineDim); Code; JobJnlLine2 := JobJnlLine; Now the problem: Just prior to when the time go insert the Job Ledger Entry occures, dimension management is used to transfer Journal Dimensions to the Ledger Dimensions. Dim management does not ‘FIND’ the dimensions in the temp table variable! [V] So, to test this, I commented out the call to Dimension Management and insted use this code IF TempJnlLineDim.FIND('-') THEN REPEAT LedgerEntryDim.INIT; LedgerEntryDim."Table ID" := DATABASE::"Job Ledger Entry"; LedgerEntryDim."Entry No." := JobLedgEntry."Entry No."; LedgerEntryDim."Dimension Code" := TempJnlLineDim."Dimension Code"; LedgerEntryDim."Dimension Value Code" := TempJnlLineDim."Dimension Value Code"; UNTIL TempJnlLineDim.NEXT = 0; Still no Dimensions! [:(]

Hi Bill, Your second code snip above looks like it is taken verbatim from Cdu 202 - Job Jnl.- Post Line, procedure RunWithCheck. That procedure is called with two input parameters: JobJnlLine2 and TempJnlLineDim2. In order to make the contents of TempJnlLineDim2 ‘visible’ to the rest of the codeunit, this procedure needs to copy the dims from TempJnlLineDim2 into the codeunit’s global temp TempJnlLineDim. It starts by emptying TempJnlLineDim of anything left over from a previous call, then asks DimMgt to copy the contents of TempJnlLineDim2 to TempJnlLineDim. Your substitute code (as best I can tell) is looking for recs in TempJnlLineDim – it was emptied in the second and third line of your snip #2, so I wouldn’t expect to find anything there. The question is: before the call to DimMgt to copy TempJnlLineDim2 to TempJnlLineDim, does TempJnlLineDim2 contain anything? Since DimMgt doesn’t seem to find anything, you’ve got to go back to the proc that calls JobJnlPostLine.RunWithCheck and make sure that the temp being used in the call contains recs, and doesn’t have strange filters set that make the recs ‘invisible’… Hope this helps. Fritz