Making the execution of OnModify dependent from a variable ?
gazpacho
Member Posts: 48
Hi
I defined the OnModify-trigger in a table. I want it to be run in normal daily use of Navision. But now I need a special action (from a separate codeunit) to be run once a month and is time-consuming. Problem is that I don't want the onmodify-trigger to be run when this specific action is run. Therefore I want to disable the OnModify-trigger, or make it variable dependent, when performing this specific action. Is there a way to use a sort of system-wide variable in order to determine from which object the call came (and so decide whether the onmodify must be run by a if-then statement) ?
Thanx
Gaz
I defined the OnModify-trigger in a table. I want it to be run in normal daily use of Navision. But now I need a special action (from a separate codeunit) to be run once a month and is time-consuming. Problem is that I don't want the onmodify-trigger to be run when this specific action is run. Therefore I want to disable the OnModify-trigger, or make it variable dependent, when performing this specific action. Is there a way to use a sort of system-wide variable in order to determine from which object the call came (and so decide whether the onmodify must be run by a if-then statement) ?
Thanx
Gaz
0
Comments
-
gazpacho wrote:Hi
I defined the OnModify-trigger in a table. I want it to be run in normal daily use of Navision. But now I need a special action (from a separate codeunit) to be run once a month and is time-consuming. Problem is that I don't want the onmodify-trigger to be run when this specific action is run. Therefore I want to disable the OnModify-trigger, or make it variable dependent, when performing this specific action. Is there a way to use a sort of system-wide variable in order to determine from which object the call came (and so decide whether the onmodify must be run by a if-then statement) ?
Thanx
Gaz
Use Setup tables. Like table 98 -"General Ledger Setup" or 331 - "Sales & Receivables Setup". Add field to the tabel and use it in triger.
BostjanL0 -
There is no such thing to set up that will work system wide, without having to do extensive development. You can choose to run the OnModify trigger by calling it with a boolean [MODIFY(TRUE) will run the OnModify trigger, MODIFY(FALSE) will not, and FALSE is the default value].
So, you could add a boolean type variable to your process and use it to run the trigger. For instance you could add a boolean var called 'RunIt' that you set depending on the relevant conditions. You could then program the modify statements in your process with that variable, like MODIFY(RunIt).
HTH0
Categories
- All Categories
- 75 General
- 75 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
