Dimension not update in G/L entry

yvonne
Member Posts: 31
I need to populate default dimension value into "Shortcut Dimension 5" in Journal Entry based on Account No entered by user.
I have no problem to display the dimension value in Journal Entry, however the dimension value is not update in Journal Line Dimension table. (Journal Entry - line button - dimension is emtpy).
Please advise & thank you very much #-o
I have no problem to display the dimension value in Journal Entry, however the dimension value is not update in Journal Line Dimension table. (Journal Entry - line button - dimension is emtpy).
Account No - OnValidate() ..... IF ("Account No." = '80') OR ("Account No." = '73') THEN BEGIN BankAccPosting.RESET; BankAccPosting.SETFILTER(BankAccPosting.Code,BankAcc."Bank Acc. Posting Group"); IF BankAccPosting.FIND('-') THEN BEGIN "Shortcut Dimension 5 Code" := BankAccPosting."G/L Bank Account No."; Validate("Shortcut Dimension 5 Code"); END; END; Shortcut Dimension 5 Code - OnValidate() CheckBankCashFlow; ValidateShortcutDimCode(5,"Shortcut Dimension 5 Code");
Please advise & thank you very much #-o
0
Answers
-
yvonne wrote:I need to populate default dimension value into "Shortcut Dimension 5" in Journal Entry based on Account No entered by user.
I have no problem to display the dimension value in Journal Entry, however the dimension value is not update in Journal Line Dimension table. (Journal Entry - line button - dimension is emtpy).Account No - OnValidate() ..... IF ("Account No." = '80') OR ("Account No." = '73') THEN BEGIN BankAccPosting.RESET; BankAccPosting.SETFILTER(BankAccPosting.Code,BankAcc."Bank Acc. Posting Group"); IF BankAccPosting.FIND('-') THEN BEGIN "Shortcut Dimension 5 Code" := BankAccPosting."G/L Bank Account No."; Validate("Shortcut Dimension 5 Code"); END; END; Shortcut Dimension 5 Code - OnValidate() CheckBankCashFlow; ValidateShortcutDimCode(5,"Shortcut Dimension 5 Code");
Please advise & thank you very much #-o
Shortcut Dimension 5 does not normally exist, so it must be customization. You will need to check with who ever added that code.David Singleton0 -
David is right.
Normally, in journal tables, you only have Shortcut Dimension 1 and 2 (the so called "global" dimensions). If you check these fields, you'll se there is some code in the OnValidate-trigger: e.g.:
ValidateShortcutDimCode(1,"Shortcut Dimension 1 Code");
So, you probably added a new field "Shortcut Dimension 5 Code" in your Journal table. You'll have to put this code OnValidate:
ValidateShortcutDimCode(5,"Shortcut Dimension 5 Code");
For the LookUp, you'll have to define a TableRelation:
"Dimension Value".Code WHERE (Global Dimension No.=CONST(5))
For this to work, make sure the field "Global Dimension No." in the table "Dimension Value" is automatically filled in for non-global dimensions as well. for this: modify the OnInsert & OnModify trigger of table "Dimension Value".
In table "Journal Line Dimension", you should modify the OnInsert, OnModify and OnDelete trigger to update your new shortcutdimension as well.
You see it's not just "adding a new field", but it involves some programming.
Is this enough info?0 -
Thank you for reply. As i am beginner therefore not great understand dimension workflow.
Yes, It is customise field in journal entry form. These are the codes i added in table Gen. Journal Line.
I don't understand why system can capture Dimension value if I enter the value code manually or select from lookup list, but system fail to capture the dimension value if i pass in Account No-On Validate, as from coding i paste did add validation function in Shortcut Dimension 5 Code -Onvalidate
ValidateShortcutDimCode(5,"Shortcut Dimension 5 Code")0 -
Well,
there is also a function "CreateDim" in the Gen. Journal Line table.
This function is called OnValidate of the field "Account No".
You'll need to add some code to also insert/update the Shortcut Dimension 5 Code field.
:-k
Or ... just update the OnValidate trigger with code to insert/update your new field.0 -
Hi Waldo, thanks for helping hand... you remind me "Create Dim" function in Gen. Journal Line table.
I add VALIDATE("Shortcut Dimension 5 Code"), after "Create Dim" function on "Account No." field. It solved all problem. All dimension value update accordingly.
Thank you very much0 -
Thank you for guidance.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions