Change in Currency code is not in log entry

tvandongentvandongen Member Posts: 78
We have sometimes that on the customer and contact card the currency code is deleted. We have the change log activated for all fields (customer, contact and vendor tables), but this change is not registered.
I've done some tests and if I change de currency code on de contact card it is also changed on the customer card. When I then check the change log there is one entry for the change of the contact card, but not for the change of the customer card.
I also tried to put some extra code on the customer card, but this code is not executed when it is changed through the contact card.

Does anybody know how I can find out which function is responsible for the unwanted change or how I can enable the logging for this.

Answers

  • kinekine Member Posts: 12,562
    Check the codeunit 5055 and 5056 etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • tvandongentvandongen Member Posts: 78
    Kine,

    I've checked them, but that are the standard navsion functions. In these functions there is only the code:
    WITH Cust DO BEGIN
      GET(ContBusRel."No.");
      NoSerie := "No. Series";
      TRANSFERFIELDS(Cont);
      "No." := ContBusRel."No.";
      "No. Series" := NoSerie;
      MODIFY;
    END;
    

    So maybe the transferfields is creating this issue, but how can I log that ?
  • kinekine Member Posts: 12,562
    Change log is logging only changes made by users. If the change is made by code, it is not logged (as you experienced). Solution is to add code calling the Change log functionality. You can search this forum for that, or look into the codeunit 1, function OnGlobalModify what is called there and call same code from the appropriate point in the process...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • tvandongentvandongen Member Posts: 78
    Thanks Kine,

    I've now modified codeunit 5055 into
    WITH Cust DO BEGIN
      GET(ContBusRel."No.");
      NoSerie := "No. Series";
      xRecRef.GETTABLE(Cust);
      TRANSFERFIELDS(Cont);
      "No." := ContBusRel."No.";
      "No. Series" := NoSerie;
      MODIFY;
      RecRef.GETTABLE(Cust);
      ChangeLogMgt.LogModification(RecRef,xRecRef);
    END;
    

    and this resulted in the correct logging.
  • kinekine Member Posts: 12,562
    You are welcome... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.