Update form after table trigger OnModify

elTorito
Member Posts: 191
Hi,
in one of my Tables I have a OnModify Trigger where i put new Date and Time for my data record.
I use a Form for Change the Data Record, when i edit the record with the form the date and the time will changed in table, thats is correct.
In my Form i have two textboxes where i read the date and the time of the data record, but after change the record it doesn't update. Only when i go out of the form and open it again or i scroll forward or back data records.
What must i do so that this fields are changed at the moment when i edit the record ?
Thanks
in one of my Tables I have a OnModify Trigger where i put new Date and Time for my data record.
I use a Form for Change the Data Record, when i edit the record with the form the date and the time will changed in table, thats is correct.
In my Form i have two textboxes where i read the date and the time of the data record, but after change the record it doesn't update. Only when i go out of the form and open it again or i scroll forward or back data records.
What must i do so that this fields are changed at the moment when i edit the record ?
Thanks
(Oo)=*=(oO)
0
Comments
-
The OnModify trigger for the record happans only when you are leaving record (close/open or scroll up/down and back).
I suggest you put the code OnValidate (on each field of your table - or at least on fields you are changing and want to change date time fo rec) you don't need the code onModify.®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
And to answer your question....
To make the form refresh after a field is validated, you put CurrForm.UPDATE into the field's OnAfterValidate trigger.0 -
Actually CurrForm.UPDATE is (usually) not needed. The controls that show field values of froms "rec" are refreshed automatically.
Even if you have some controls to show globals on form that are changed, you don't have to call CurrForm.UPDATE. But not allways.
It's kind of hard to explain exactly when do you need to call and when not. Usually you try without CurrForm.UPDATE and if changes are not seen you try with CurrForm.UPDATE. Sometimes even that doesn't help.®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
you're right, you don't always need the CurrForm.UPDATE, and it also doesn't always work. Just try these things until it works for you. When it does, stop trying and take a break
. At some point you'll get used to Navision's funky ways.
0 -
Thank you for the answers.(Oo)=*=(oO)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