Intercept Manual Modification
Belias
Member Posts: 2,998
Hi everyone, i am trying to intercept if the user modifies the record manually or if the record is modified by a process.
This is useful because i have a field "document status" which is automatically updated by some processes.
the possible values of this field are (" ", error, checked, created, posted). If the user modify the record, the status must be set back to " ", but my processes are free to change this status.
Moreover, the OnModify Trigger of the table have always to be called (both from process and from user interaction).
For this reason, i can't put the code for blanking the "document status" in the onmodify trigger of the table, because it would overwrite the value set by the process (e.g.: "Check" function set the status to Checked and then do a MODIFY(TRUE)).
I solved it putting the code for blanking the "document status" in the OnModifyRecord trigger of the page, but i was wondering if there's another way to solve it (i personally like this solution, but i was wondering if there's a different one).
Thanks in advance
This is useful because i have a field "document status" which is automatically updated by some processes.
the possible values of this field are (" ", error, checked, created, posted). If the user modify the record, the status must be set back to " ", but my processes are free to change this status.
Moreover, the OnModify Trigger of the table have always to be called (both from process and from user interaction).
For this reason, i can't put the code for blanking the "document status" in the onmodify trigger of the table, because it would overwrite the value set by the process (e.g.: "Check" function set the status to Checked and then do a MODIFY(TRUE)).
I solved it putting the code for blanking the "document status" in the OnModifyRecord trigger of the page, but i was wondering if there's another way to solve it (i personally like this solution, but i was wondering if there's a different one).
Thanks in advance
0
Answers
-
I'm thinking about Change log functionality if Nav.
It monitors changes made by the user but not by code. Could this be a starting point? :-k0 -
1st: i've never used it :oops:
2nd: i only need this functionality for this page...isn't the change log too much? (i repeat that i've never used it)
Should my customer buy another granule for the change log?0 -
Belias wrote:1st: i've never used it :oops:
2nd: i only need this functionality for this page...isn't the change log too much? (i repeat that i've never used it)
Should my customer buy another granule for the change log?
To be honest I don't know about the granule and I don't have the documents with me.
If it were used then it would require customization to some degree...
Look in codeuint 1 the GlobalInsert / GlobalModify triggers and the changelog objects to see how it works...0 -
If you need to know whether it was changed manually or not then put the code on the form. The Form's validate trigger should only be called when a user is actually changing the value and moves to another field. Then the table validation takes place. Usually in code the first does not happen.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
