Question about triggers of a Form

tompynation
Member Posts: 398
The OnafterGetRecord trigger, why is this trigger being executed more then once if you stay on the same record?
For example, when you have a form with a tabcontrol on it...
Each time you switch from tab, the OnAfterGetRecord gets executed :?:
Why is this?
Is there any other trigger i could use, wich get called only once?
Untill you go to the next / previous record?
For example, when you have a form with a tabcontrol on it...
Each time you switch from tab, the OnAfterGetRecord gets executed :?:
Why is this?
Is there any other trigger i could use, wich get called only once?
Untill you go to the next / previous record?
0
Comments
-
You could always do something like...
IF Rec <> xRec THEN BEGIN //... END;
I think that has worked for me in the past.
Otherwise you could just create a variable and assign it the primary key value of the current record, and if it re-occurs then don't execute your code.0 -
tompynation wrote:The OnafterGetRecord trigger, why is this trigger being executed more then once if you stay on the same record?
For example, when you have a form with a tabcontrol on it...
Each time you switch from tab, the OnAfterGetRecord gets executed :?:
Why is this?
Is there any other trigger i could use, wich get called only once?
Untill you go to the next / previous record?
Check "OnAfterGetCurrRecord". The OnAfterGetRecord is called each time the record is displayed.0 -
The work of the OnafterGetRecord trigger is very easy:
The code in this trigger is executed before it is displayed on form but after the record is retrieved from the table. So, no problem in a TabControl based Form (it shows only one rec). But on a table box form, Navision calls this trigger for each record :!:
So, when you will only run code on you Current Record in tablebox form, you should use the trigger OnAfterGetCurrRecord.
The code in this trigger is also executed after the current record is retrieved from the table. So, if you have a table box form, and you have code in this trigger, the system only calls this trigger when it updates the current record in the table box. And this is what you need ;-)
RegardsDo you make it right, it works too!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