Log your changes

From time to time we get into the situation where we need to run a batch report to update data in NAV. It’s always nice to log changes and there’s an easy way to do it by calling the standard Change Log functionality.

This example blocks all Norwegian customers and writes the changes to the Change Log.

2015-09-08_10-50-36

Tags:

One Response to “Log your changes”

  1. Lars Westman 2016-03-04 at 15:25 #

    In NAV 2013 and later versions you only need this:

    RecRef.GETTABLE(Customer);
    ChangeLogMgmt.LogModification(RecRef);
    Cust.MODIFY;

    This is because NAV2013 calls codeunit 423 in the OnDatabaseInsert/Modify/Delete triggers in codeunit 1 and will catch any differences in the RecRef we previously sent in as a parameter.

Leave a Reply