Code of onvalidate trigger of Post Code
amitagupta
Member Posts: 43
Dear All,
Can anybody please explain why Validation Code is written in OnValidate() trigger of Post Code field of any master table? ValidateTableRelation & TestTableRelation properties is set to "NO" for the same...
Thanks,
Amita
Can anybody please explain why Validation Code is written in OnValidate() trigger of Post Code field of any master table? ValidateTableRelation & TestTableRelation properties is set to "NO" for the same...
Thanks,
Amita
0
Comments
-
You need the code because you have some special functionality on post codes/city. If you type post code and a city exists it auto inserts city. If you find more than one city for the post code you can choose which city you want inserted. This is to ease typing and cant be done by a mere tablerelation. The no in testtablerelation is done because so you dont need to have all post codes in the world in your database.0
-
Thanks for the reply...
My question is...at what point of time does is get executed? I put a breakpoint on the code and selected post code from (say) Vendor Card. The code never executed...!0 -
The code is in table and not in form.0
-
I know that the code is at table level ... but whats the use of it?0
-
If the post code doesnt exists in your post code table the code exits. Do you have the post code in the table? If i was you i would read the code on the post code table(think there are 3 functions), or have a developer explain it to me.0
-
If are with trouble applying breakpoint, activate debug but stopping in every trigger, and watch code flow.0
-
Mbad wrote:Do you have the post code in the table? If i was you i would read the code on the post code table
The field I am talking about is on master tables like Customer/ Vendor.nunomaia wrote:If are with trouble applying breakpoint, activate debug but stopping in every trigger, and watch code flow
I have tried this also. The code does not get executed only...0 -
amitagupta wrote:Mbad wrote:Do you have the post code in the table? If i was you i would read the code on the post code table
The field I am talking about is on master tables like Customer/ Vendor.
The data im talking about is table 225. Does the code you enter exist there?0 -
The code I am talking about is table 18:
Post Code - OnValidate()PostCode.ValidatePostCode(City,"Post Code");
What is the use of it???0 -
When you insert a post code, insert the city if there is a mach in Post Code Table0
-
OnValidate only fires when the field is actually validated. Just selecting it will not do this. Put your cursor in the field, turn on the debugger, hit F2 and tab away. This should start the debugger (make sure 'breakpoint on triggers' is on).0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
