OnGlobalModify.... - EDIT: Change Log does not work

MiSta
Member Posts: 19
Hello,
if i change a record i.e. in table 36, the OnGlobalModify-Trigger in Codeunit 1 is not
run through. I am not changing the record by code. I am simply modifying a field in form 42.
Is this a bug in version 6.00.30232 or am I doing something wrong?
Thank you very much in advance
MiSta
if i change a record i.e. in table 36, the OnGlobalModify-Trigger in Codeunit 1 is not
run through. I am not changing the record by code. I am simply modifying a field in form 42.
Is this a bug in version 6.00.30232 or am I doing something wrong?
Thank you very much in advance
MiSta
0
Answers
-
Hi,
the OnglobalModify will only run if you allow it to run in the"GetGlobalTriggerMask".
You will have to modify the code in that trigger if you don't have the Change Log turned on for your table.
You will have to provide the exit code for that trigger that will determine what triggers will be executed.
Where the exit code equals:
1 for Insert
2 for Modify
4 for Delete
8 for Rename.
So if you want to execute every global trigger except the GlobalDelete Trigger the exit code should be 11 (Insert + Modify + Rename = 1 + 2 + 8. )
Be very very very very careful that you do not break the Change Log Managment with your changes or cause other serious issues.
Hope this helps,
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
KYDutchie wrote:the OnglobalModify will only run if you allow it to run in the"GetGlobalTriggerMask".
Did you mean GetTableTriggerMask? The function in Codeunit 423, Change Log Management?
This is a great post, very interesting.0 -
Thanks.
Actually my problem is, that the Change Log does not work. The setup is correct:
- Change Log Setup: Change Log Activated
- Change Log Setup (Table): Table 36/All Fields/All Fields/All Fields
Any change in table 36 is not logged.
The same, if try table 37 etc.
The changes I made in table 403 (Change Log Setup (Table)) are logged, however.
Anybody any Ideas?
Thanks again in advance.0 -
Hi Mattrax,
The GetTableTriggerMask in CU423 checks the tableID in the "GetGlobalTableTriggerMask" against the Change log setup table.
But if you only want to track one table, without turning on the Change log, you can build the following construction in your "GetGlobalTableTriggerMask".
Declare 2 local integer variables called "MyTableMask" and "ChangeLogMask"Clear(MyTableMask) IF TableID = Database::"Sales Header" THEN MyTableMask := 11; //Checking Insert, Modify and Rename ChangeLogMask := ChangeLogMgt.GetTableTriggerMask(TableID); IF MyTableMask > ChangeLogMask THEN EXIT(MyTableMask) //Will cause the Global Insert, Modify and Rename triggers to be executed based on the table action ELSE EXIT(ChangeLogMask);
But be carefull that you might have to stop processing of the Changelog when you get to the other global table triggers.
Hopes this helps,
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Mista,
What field are you changing? Fields Like the "Status" field in the sales header table are not tracked by the Change Log.
This is because the change does not happen in the form but in codeunit 414.
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Hi Willy,
does not depend on the field. No field works.
I.e., I am changing the field "Bill-to Name". Neither code on the form nor on the table, regarding this field.
I am changing the field on form 42.
Client is restarted....
MiSta0 -
Hi Mista,
I just tested this on the same version. And mine does track the change to the "Bill-to Name".
It does show up in the Change log as "Name" since the Caption of the field is "Name".
Maybe you can run with the debugger and see why it never gets to the GlobalModify trigger.
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Errm, this may be obvious, but the client does have to be restarted for change log configuration changes to take effect.Robert de Bath
TVision Technology Ltd0 -
Hi,
I made a test (modify the "Sell-to Customer No." by LookUp) and everything's fine : lot of entries in Change Log...
Put Breakpoint on OnGlobalModify in Codeunit 1. And see what's happens.Dynamics Nav Technical Consultant
Working with Bug and Debbugger0 -
OK, Thanks to all, did not help though:)
As mentioned in my original post, the OnGlobalModify Funktion is not ran through.
I think I have to find another solution.0 -
Mista,
Put a breakpoint in this trigger: "GetGlobalTableTriggerMask" in codeunit 1.
What I would do is put a dummy statement into that trigger. Just create a local variable called "A" and add a line prior to the exit statement like "A:=A".
Put the breakpoint on that dummy statement.
It has to come to that trigger and check the value that is returned from the Change log management codeunit.
I suspect that that value does not include the modify value.
Regards,
Willy
PS: Remove the local variable and dummy statement when you are done. :oops:Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Problem is solved.
There was a bug in CU423. Somebody deleted an important line:)
Thanks you very much nonetheless.
MiSta0 -
Do you remember what the bug was. I am having the exact same issue. The system is not tracking Sales Invoice Line even though the Change Log is configured to keep track of All Fields for Insert, Modify, and Delete.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