Adding new field in 'Value entry' table, to sync the data from customer table, territory code.

ManiNav
Member Posts: 120
Hi Everyone,[NAV 2009 R2]
I am trying to sync data of the field "Territory code" from customer card to the new field(Custom field) in "Value entry" table. I have written below code in new field on validate trigger, but after posting sales order; my new field is not getting update in Value entry table.
New field- onValidate trigger()
IF "Source Type" = "Source Type":: Customer THEN BEGIN
Cust.GET("Source No.");
"Territory Code" := Cust."Territory Code";
MODIFY;
END;
Please assist me, what i am doing mistake or what is the correct way to do for my requirement.
Thanks,
Mani.
I am trying to sync data of the field "Territory code" from customer card to the new field(Custom field) in "Value entry" table. I have written below code in new field on validate trigger, but after posting sales order; my new field is not getting update in Value entry table.
New field- onValidate trigger()
IF "Source Type" = "Source Type":: Customer THEN BEGIN
Cust.GET("Source No.");
"Territory Code" := Cust."Territory Code";
MODIFY;
END;
Please assist me, what i am doing mistake or what is the correct way to do for my requirement.
Thanks,
Mani.
0
Answers
-
The fields in the value entry table are filled up without using validate. You need to put your code in the posting codeunit that writes to this table. In this case : codeunit 22.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Kriki,
Thank you so much for your reply,
I created flow-field in value entry table for the territory code of customer table, and data get synced.
Based on your suggestion:-
I checked codeunit:22 to write in value entry table, but i am not sure that where should i assign for territory code in new field of value entry table.
Thanks alot...
Regards,
Mani.0 -
In general, that kind of code is written just before the INSERT statement of that table. Same rule for all Ledger tables.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
But also a flowfield can serve the purpose. What is better? It depends. If you need to read or filter on that field, it is better a real field for performance.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Whatever your business goal with this territory field, I believe you can use dimensions for that.1
-
Flow Fields are not recommended normally keeping performance in mind.
Dimension could be one of the Option provided you have significant amount of knowledge how Global and Shortcut Dimension works.
Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/1
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