Change Log Entry for table 336

snehasneha Member Posts: 191
Since change log doesn’t monitor the changes by C/AL code, I wanted to achieve it through by adding additional code.
Basically, I want to record all the user changes occurred on item tracking lines form. I tried to add the below lines of code to OnInsert,OnModify trigger on the form 6510 (Item Tracking Lines), but no result in change log entry.
// >>
RecRef.GETTABLE(Rec);
xRecRef.OPEN(RecRef.NUMBER);
xRecRef.GET(RecRef.RECORDID);
ChangeLogManagement.LogModification(RecRef,xRecRef);
// <<

What I am missing.

Comments

  • AndwianAndwian Member Posts: 627
    There is a platform update that could resolve the issue in Change Log Mgt., but I could not assure if this could resolve your problem. Worth to try.
    Regards,
    Andwian
  • ara3nara3n Member Posts: 9,256
    oninsert and onmodify triggers only get triggered if the CAL code calls them

    So if CAL code is


    Reservationentry.insert;


    it will not trigger the oninsert.

    if the code is
    Reservationentry.insert(true);


    Then it will trigger oninsert

    As above post mentioned that in NAV 2009 R2 NAV has added a new trigger in CU that gets triggered no matter if your code is set to insert or insert(true);

    This trigger is called for every table. So you have to structure your code.



    Now having said all this, logging reservation entry is a horrible idea. If you are using lot tracking/serial no.

    Any inventory transaction will have many transaction hitting this table multiple times. This is one of the busiest table for lot/SN tracked item, or if you are using reservation or item tracking or running MRP/MPS.


    So tell the customer that the info they will receive from this log table will be useless and have horrible performances.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • snehasneha Member Posts: 191
    Thank you all for your help.
    We are on Nav 5.0 SP1. Yes, we are using lot and serial tracking. Basically, WH supervisor would like to track who has assigned the serial no,bin no,etc.. and who changed it later on the sales order. We have 10 WH workers, all of them having the similar roles and permissions.
  • DenSterDenSter Member Posts: 8,305
    ara3n wrote:
    logging reservation entry is a horrible idea
    I just want to point this out again. The Reservation Entry table is already a pain in the butt for performance. Adding change logging to it will only make it worse.
Sign In or Register to comment.