Global Dimension 3

After MUCH ado I’ve been able to create a “Global Dimension 3”. I’m able to use this new Dimension on the Account Schedule Column Layouts. That last piece to my puzzle is back filling the G/L Entry Table with the data from the Ledger Entry Dimension table. I wrote a report that I had hoped would do the trick but I seem to have missed my mark: IF recDimEntry.“Dimension Value Code” := “CLIENT EVENT” THEN IF recDimEntry.“Entry No.” = GLEntry.“Entry No.” THEN GLEntry.“Global Dimension 3 Code” := recDimEntry.“Dimension Value Code”; GLEntry.Modify; “Client Event” is the Value Code for Global Dimension 3. The report runs but it doesn’t update the G/L entry table. [V]

Don’t you need begin end for the second If condition, So that it will only modify,when you change it.

I am not sure what your dataitem are… IF DimEntry."Dimension Value Code" := 'CLIENT EVENT' THEN **BEGIN** (Changed " to ') IF DimEntry."Entry No." = GLEntry."Entry No." THEN **BEGIN** GLEntry."Global Dimension 3 Code" := recDimEntry."Dimension Value Code"; GLEntry.Modify; **END;** **END;** I know you do not need the top BEGIN, but I do it all the time to increase readability

You could also do something in the line of: **GL Entry - OnAfterGetRecord()** (Data Item) if not LedgerEntryDimension.get(Database::"G/L Entry","Entry No.",'CLIENT EVENT') THEN CurrReport.skip; "Global Dimension 3" := LedgerEntryDimension."Dimension Value Code"; Modify;

Have you changed / looked at Report 83 - Change Global Dimensions, by the way …

Thank you for al your input Henrik. I’ve inserted the following: IF DimEntry.“Dimension Value Code” := ‘CLIENT EVENT’ THEN BEGIN (Changed " to ') IF DimEntry.“Entry No.” = GLEntry.“Entry No.” THEN BEGIN GLEntry.“Shortcut Dimension 3 Code” := recDimEntry.“Dimension Value Code”; GLEntry.Modify; END; END; And I’m getting the error “The expression is code. There must be a ‘TRUE/FALSE’ expression in the IF, WHILE or REPEAT sentence…” I’m new to this (in case you couldn’t tell) and your help is greatly appreciated.

IF DimEntry.“Dimension Value Code” = ‘CLIENT EVENT’ THEN BEGIN // “=” instead “:=”

Thank you for your help. Henrik’s second suggestion did the trick [:D]: GL Entry - OnAfterGetRecord() (Data Item) if not LedgerEntryDimension.get(Database::“G/L Entry”,“Entry No.”,‘CLIENT EVENT’) THEN CurrReport.skip; “Global Dimension 3” := LedgerEntryDimension.“Dimension Value Code”; Modify;

A tip for you all: {code} will format for code incl. spaces see {/code} Change { to [ and } to ]


Originally posted by Viktoras
IF DimEntry.“Dimension Value Code” = ‘CLIENT EVENT’ THEN BEGIN // “=” instead “:=”

DOH [:o)]

oops![V] I ran the report and it updated my Dimension 3 code, but it deleted all my Global 1 and 2 data. IF NOT LedgerEntryDimension.GET(DATABASE::“G/L Entry”,“Entry No.”,‘CLIENT EVENT’) THEN CurrReport.SKIP; “Shortcut Dimension 3 Code” := LedgerEntryDimension.“Dimension Value Code”; MODIFY;

Not good - That does not make any sence, what-so ever you can e-mail me the report to messenger e-mail address (view my profile) - Hopefully you can still have a long laborday weekend :wink: