NAV2013 Upgrade Codeunit 1 ApplicationManagement

sydaussydaus Member Posts: 10
edited 2014-03-19 in NAV Three Tier
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.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    And what error-message does it give?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • sydaussydaus Member Posts: 10
    kriki wrote:
    And what error-message does it give?

    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?
  • krikikriki Member, Moderator Posts: 9,110
    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!


  • sydaussydaus Member Posts: 10
    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?
  • krikikriki Member, Moderator Posts: 9,110
    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!


  • sydaussydaus Member Posts: 10
    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.
  • jordi79jordi79 Member Posts: 273
    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.
Sign In or Register to comment.