How to log field changes in D365 Finance and Supply Chain

Lets suppose we have a need to log changes to a specific field in Dynamics 365.  For our example today lets say that we want to log changes that are made to the resource names in the resources table.  

When we right click on the name we can see that this belongs to table wrkctrTable and the field name is Name.  We can audit this field by going into System Administration -> Setup -> Database log -> Database Logging Setup.  When the screen loads we can see fields that are already setup to be logged.  If the screen is blank no fields are currently setup to be logged.

To add our field we’ll want to click on the New button.  This will launch a wizard that will guide us through the process of setting up the field to be audited.

When the wizard loads its helpful to check the show all tables and show table names field.  This can help us ensure that we are grabbing the correct field.

If we look down the list of tables we can see a section called resources, and if we expand that section we can find our wrkctrTable.  Once we expand that section we can see the name field.  As you locate the field select the check box next to it and then click Next.  

The next screen that is presented will allow you to select exactly which fields you want to audit if you’ve selected more than one fields or entire tables or in our case it will show the one field that we have selected.  We’ll click the update box to indicate that we want to log when this field is updated.

 

Now all we have to do is click next then finish to close the wizard.

In order to test our change we can go back into the production control module and find the resources.  All we need to do is make a change.

After we make our changes we need to go to System Admin -> Inquiries -> Database -> Database log.

As we can see below the user that made the change is logged as well as the current and previous value have been logged.

An important item is that you need to setup the database log clean up job under system admin -> Periodic -> Database, prior to setting up your fields to audit.

Another important item is that this can affect performance so you don’t want to set this up on anything transactional or any data that changes a lot.  This is good for auditing tables that are pretty much static and don’t change a lot.