...
IF TempSelectedDim.GET(USERID,3,REPORT::"Export Consolidation",'',LedgEntryDim."Dimension Code") THEN BEGIN
// Delete the following lines.
TempDimBufIn.INIT;
TempDimBufIn."Table ID" := DATABASE::"G/L Entry";
TempDimBufIn."Entry No." := "Entry No.";
// End of the lines.
IF TempDim.GET(LedgEntryDim."Dimension Code") THEN
IF TempDim."Consolidation Code" <> '' THEN
// Delete the following lines.
TempDimBufIn."Dimension Code" := TempDim."Consolidation Code"
ELSE
TempDimBufIn."Dimension Code" := TempDim.Code
ELSE
TempDimBufIn."Dimension Code" := LedgEntryDim."Dimension Code";
// End of the lines.
IF TempDimVal.GET(LedgEntryDim."Dimension Code",LedgEntryDim."Dimension Value Code") THEN
IF TempDimVal."Consolidation Code" <> '' THEN
TempDimBufIn."Dimension Value Code" := TempDimVal."Consolidation Code"
ELSE
TempDimBufIn."Dimension Value Code" := TempDimVal.Code
ELSE
TempDimBufIn."Dimension Value Code" := LedgEntryDim."Dimension Value Code";
TempDimBufIn.INSERT;
END;
UNTIL LedgEntryDim.NEXT = 0;
...
...
IF TempSelectedDim.GET(USERID,3,REPORT::"Export Consolidation",'',LedgEntryDim."Dimension Code") THEN BEGIN
IF TempDim.GET(LedgEntryDim."Dimension Code") THEN
IF TempDim."Consolidation Code" <> '' THEN
// Add the following lines.
DimensionCode := TempDim."Consolidation Code"
ELSE
DimensionCode := TempDim.Code
ELSE
DimensionCode := LedgEntryDim."Dimension Code";
IF NOT TempDimBufIn.GET(DATABASE::"G/L Entry","Entry No.",DimensionCode) THEN BEGIN
TempDimBufIn.INIT;
TempDimBufIn."Table ID" := DATABASE::"G/L Entry";
TempDimBufIn."Entry No." := "Entry No.";
TempDimBufIn."Dimension Code" := DimensionCode;
// End of the lines.
IF TempDimVal.GET(LedgEntryDim."Dimension Code",LedgEntryDim."Dimension Value Code") THEN
IF TempDimVal."Consolidation Code" <> '' THEN
TempDimBufIn."Dimension Value Code" := TempDimVal."Consolidation Code"
ELSE
TempDimBufIn."Dimension Value Code" := TempDimVal.Code
ELSE
TempDimBufIn."Dimension Value Code" := LedgEntryDim."Dimension Value Code";
TempDimBufIn.INSERT;
END;
// Add the following line.
END;
UNTIL LedgEntryDim.NEXT = 0;
...