Hi,
I got a problem of the customization on Function OnGlobalInsert, OnGlobalModify, OnGlobalDelete and OnGlobalRename in Codeunit 1 ApplicationManagement while upgrading the client’s database from NAV2009 R2 to NAV2013.
There are customized codes as follows in client’s NAV2009R2 database. The customized codes will call a Synchronization function to update item table in other companies in this database.
OnGlobalInsert(RecRef : RecordRef)
ChangLogMgt.LogInsertion(RecRef);
ItemSynMgt.ShareInsertion(RecRef, FALSE); // << Customized Codes
OnGlobalModify(RecRef : RecordRef;xRecRef : RecordRef)
ChangLogMgt.LogModification(RecRef,xRecRef);
ItemSynMgt.ShareModification(RecRef); // << Customized Codes
OnGlobalDelete(RecRef : RecordRef)
ChangLogMgt.LogDeletion(RecRef);
ItemSynMgt.ShareDeletion(RecRef); // << Customized Codes
OnGlobalRename(RecRef : RecordRef;xRecRef : RecordRef)
ChangLogMgt.LogRename(RecRef,xRecRef);
// << Customized Codes
IF ItemSyncSharingInstance.GetRenameTriggeredBy = '' THEN
ItemSynMgt.ShareRename(RecRef, xRecRef);
// >> Customized Codes
In NAV2013, there are no OnGlobalInsert, OnGlobalModify, OnGlobalDelete and OnGlobalRename in Codeunit 1. NAV2013 put the codes like “ChangeLogMgt.LogInsertion(RecRef);” in function OnDatabaseInsert in Codeunit 1. But if I also put customized codes in function OnDatabaseInsert, the system will get an error message and stop the NAV service.
Does anyone give a help on how to merge customized codes on OnGlobalModify into NAV2013?
Your help will be greatly appreciated.
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Error Message:
The server "net.[url=tcp://localhost:7046/DynamicsNAV70/Service]tcp://localhost:7046/DynamicsNAV70/Service[/url]" is either unavaible or your connection has been lost. Do you want to attempt to reconnect?
Try the debugger to find out where it goes wrong. (you're lucky you are on NAV 2013!)
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
IF lvRecFieldsModified > 0 THEN
NewRecRef.MODIFY;
It seems that NewRecRef.MODIFY fired the function of OnDatabaseModify in Codeunit 1.
What is different between function OnDatabaseModify and OnGlobalModify?
Could I call any similar function like OnGlobalModify in NAV2013?
OnDatabaseModify: new version. Is ALWAYS triggered.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Hi kriki,
That is great. It is working now.
I put the the following codes back into NAV2013.
1)
Codeunit 1 ApplicationManagement:
GetGlobalTableTriggerMask
OnGlobalInsert
OnGlobalModify
OnGlobalDelete
OnGlobalRename
2)
Codeunit 423 Change Log Management:
GetTableTriggerMask
Thank you very much.
I am trying to achieve something similar. I am trying recreate the OnGlobal.... triggers in CU1 in NAV2013R2 so that I can program something into these triggers. After adding in the old OnGlobal.... triggers, I face the error below when trying to insert any records into the database.
Microsoft Dynamics NAV
The signature of trigger 21 in codeunit 1 has changed. Expected signature: InsertTrigger(Order POFS0001926 19-03-14 19-03-14 Order POFS0009999 0 0 No 0 No No No G/L Account No 19-03-14 P-ORD P-FT+ P-RCPT No 0 Open None 0 No New...
OK
This does not seem to be a C/AL Error as it does not trigger the debugger. On a side note, I could modify, delete and rename.