NAV2013 Upgrade Codeunit 1 ApplicationManagement
sydaus
Member Posts: 10
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.
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
-
And what error-message does it give?Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Ok, that error doesn't say anything.
Try the debugger to find out where it goes wrong. (you're lucky you are on NAV 2013!)Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I think that the error popped up from the following codes:
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?0 -
OnGlobalModify:old version. Is only triggered if a user changes a record, but NOT when a program changes a record. If I remember correctly, you can still create these functions in NAV2013 (using same ID's) to get the old functionality back.
OnDatabaseModify: new version. Is ALWAYS triggered.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kriki wrote:OnGlobalModify:old version. Is only triggered if a user changes a record, but NOT when a program changes a record. If I remember correctly, you can still create these functions in NAV2013 (using same ID's) to get the old functionality back.
OnDatabaseModify: new version. Is ALWAYS triggered.
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.0 -
Hi,
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 323 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