• Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

Olof Simren - Microsoft Dynamics 365 Business Central Blog

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ

View Change Log from Ribbon

April 25, 2014 Posted by Olof Simren Development, General, Miscellaneous 5 Comments

The Change Log in Microsoft Dynamics NAV is used to log inserts, modifications and deletions of records. This is very useful and can be an option for the users to see who created the record, what was the value of a field before, when was the last modification made, etc… If it is going to be used this way (and not only for auditing once a month) then you probably want to add an action in the Ribbon to display the Change Log Entries for the record that the user is looking at.

There are two ways to do this; with and without writing any code. We use the customer card as an example.

Without Writing Code

This option is probably the method to choose if you don’t have access to write C/AL code with your license. Although I would never recommend making changes to any objects without writing anything in the documentation trigger (but that is another subject 🙂 ).

Open the customer card page in design mode, add an action item to the page and call it ‘Change Log’.

ActionItemForChangeLog

Then go to the properties of the action item and set the following properties.

ChangeLogProperties

The Table No. is the table number of the customer table (18) and the Primary Key Field 1 Value is the primary key field from the customer table (No.).

This is it, easy! 🙂

With C/AL Code

This option has the advantage that you can just copy/paste the action item between the different pages since it is the same code for all records.

Open the customer card page in design mode, add an action item to the page and call it ‘Change Log’ (same as first option).

ActionItemForChangeLog

Then go to the C/AL code for the action item and add the following code (make the RecRef, the ChangeLogEntry and the ChangeLogEntries local variables).

ChangeLogCodeOnActionItem

This is it!

Time to Test It

Now you have a ‘Change Log’ action in the ribbon of the customer card that the users can use to easily see the change log for a selected customer.

To test this we setup the change log to log changes to the customer table, and we set it to log just some of the field. I choose the No., Name and Credit Limit ($). I think logging all the fields in a table like this creates to much ‘noise’ when looking at the log.

ChangeLogSetup

We create a customer, and then make a change to the credit limit. After this we test the new button and the change log entries page opens displaying only the changes for the selected fields for this one customer. You see who created the customer record and who have modified the logged fields (and when). Yes, it worked!

CustomerCardWithChangeLogAction

A note about the change log; you don’t want to go too crazy with logging all kinds of changes, there is a certain risk that it can affect the performance in the system if you start logging to much changes especially to tables/fields that are updated often. There is a batch job called Delete Change Log Entries, if you use the change log to keep track of who have created what record then you want to make sure you keep relevant change log entries by applying filters when running this job.

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X

Related


Discover more from Olof Simren - Microsoft Dynamics 365 Business Central Blog

Subscribe to get the latest posts sent to your email.

Tags: Change LogDevelopmentRibbon
5 Comments
Share
3

About Olof Simren

I am a Microsoft Dynamics NAV and 365 Business Central Expert, I started implementing Microsoft Dynamics NAV in 2002, back then it was called Navision Attain. Throughout the years there has been many exciting implementations in different parts of the world, all of them with different challenges but with one common theme; manufacturing. As a consultant, I bring over 20 years of experience in implementing Microsoft Dynamics NAV and 365 Business Central within manufacturing and distribution companies. The services I offer includes project management, consultation, development and training. Feel free to contact me if you need help with anything related to Microsoft Dynamics NAV or 365 Business Central. I work through my company Naviona where I team up with other skilled Microsoft Dynamics NAV and 365 Business Central Experts.

You also might be interested in

Display Symbols and Different Fonts in Dynamics NAV 2013 R2

Apr 29, 2014

Some weeks ago I came across a requirement to be[...]

Schedule MRP

Jan 7, 2016

If you have a relative large number of items to[...]

Default Dimension Priorities for Production Order Components

May 4, 2014

In one of my earlier blog posts, Dimensions on Production[...]

5 Comments

Leave your reply.
  • Change Logger
    · Reply

    May 25, 2014 at 6:29 AM

    The CAL code example is great for 2013 and onwards. Can you provide an exampe of how to do this for 2009 R2 and below?

    • Olof Simren
      · Reply

      Author
      May 25, 2014 at 4:36 PM

      Try the following code for older versions where the ‘Record ID’ field does not exist, it should work:

      RecRef.GETTABLE(Rec);
      ChangeLogEntry.SETRANGE(“Table No.”, RecRef.NUMBER);
      KeyRef := RecRef.KEYINDEX(1);
      FOR i := 1 TO KeyRef.FIELDCOUNT DO BEGIN
      FieldRef := KeyRef.FIELDINDEX(i);
      CASE i OF
      1:
      ChangeLogEntry.SETFILTER(“Primary Key Field 1 Value”, FORMAT(FieldRef.VALUE));
      2:
      ChangeLogEntry.SETFILTER(“Primary Key Field 2 Value”, FORMAT(FieldRef.VALUE));
      3:
      ChangeLogEntry.SETFILTER(“Primary Key Field 3 Value”, FORMAT(FieldRef.VALUE));
      END;
      END;
      FORM.RUN(0, ChangeLogEntry);

  • Naga
    · Reply

    May 4, 2017 at 11:32 PM

    Thanks for the great article , it is helpful.

    could you please help me to do the same thing in Nav 2005 C/AL

    • Olof Simren
      · Reply

      Author
      May 12, 2017 at 8:44 AM

      Hi Naga,
      Do you mean NAV version 5?

      I think the same method could be applied to version 5.

      /Olof

  • Andri Wianto
    · Reply

    May 18, 2020 at 9:42 AM

    Hi Olof,

    Thank you. This menu makes it more end-user friendly.

    /Andri

Leave a Reply

Your email is safe with us.
Cancel Reply

Subscribe to My Blog via Email

Check Out Our Apps in AppSource

My Dynamics NAV Partner

Naviona, LLC

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (24)
  • Manufacturing (36)
  • Miscellaneous (27)
  • Purchase (9)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM Business Central CAL Capacity Consumption Contact Copilot Costs Customer Development Dimensions Excel Finance Flushing General Ledger Inventory Item Item Tracking Low-Level Code MRP NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Receipts Reporting Reports Routing Sales Sales Order Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Shipment Work Center

Recent Posts

  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption
  • Return Merchandise Authorization (RMA)

Categories

  • Assembly
  • Development
  • Finance
  • General
  • Inventory
  • Manufacturing
  • Miscellaneous
  • Purchase
  • Sales
  • Warehouse

Contact Us

We're currently offline. Send us an email and we'll get back to you, asap.

Send Message

Categories

  • Assembly (3)
  • Development (35)
  • Finance (14)
  • General (28)
  • Inventory (24)
  • Manufacturing (36)
  • Miscellaneous (27)
  • Purchase (9)
  • Sales (11)
  • Warehouse (7)

Tags

.net Add-in AI AppSource Assembly Assembly BOM Business Central CAL Capacity Consumption Contact Copilot Costs Customer Development Dimensions Excel Finance Flushing General Ledger Inventory Item Item Tracking Low-Level Code MRP NAV 2015 NAV 2016 Output Planning Production Production BOM Production Orders Purchase Orders Receipts Reporting Reports Routing Sales Sales Order Stockkeeping Unit Subcontracting Task List Warehouse Warehouse Shipment Work Center

Recent Posts

  • Business Central Configuration Audit using Vibe Coding
  • Copilot in Planning Parameter Worksheet
  • Copilot in Planning Worksheet
  • Copilot Inventory Queries
  • Record Deletion Tool for Business Central in AppSource
  • Reopen Finished Production Orders
  • XML Buffer and CSV Buffer Tables
  • Functionality Improvements in NAV 2017
  • Reversing Production Output and Consumption
  • Return Merchandise Authorization (RMA)

Recent Comments

  • Olof on Business Central Configuration Audit using Vibe Coding
  • Andrew Trayfoot on Business Central Configuration Audit using Vibe Coding
  • Barrett Allen on Reopen Finished Production Orders
  • Kateryna on Business Central Configuration Audit using Vibe Coding
  • Takeshi Setoya on Reopen Finished Production Orders
  • Steve on Consignment Inventory
  • Olof Simren on Copilot in Planning Worksheet
  • Omaer Amjad on Copilot in Planning Worksheet

© 2026 · Olof Simren

  • Home
  • About Me
  • Contact Me
  • Downloads
  • White Papers
  • Web Sites
  • Post List
  • Articles
  • FAQ
Prev Next