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
0
Answers
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,
Willy
Did you mean GetTableTriggerMask? The function in Codeunit 423, Change Log Management?
This is a great post, very interesting.
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.
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"
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,
Willy
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,
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....
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,
Willy
TVision Technology Ltd
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.
Working with Bug and Debbugger
As mentioned in my original post, the OnGlobalModify Funktion is not ran through.
I think I have to find another solution.
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:
There was a bug in CU423. Somebody deleted an important line:)
Thanks you very much nonetheless.
MiSta