A common challenge in many business management applications is avoiding unwanted changes in data. It could be anything from an incorrect customer name to an incorrect posting to the general ledger. In this blog we will summarize how to Monitor Changes in Dynamics 365 Business Central 2020 release wave 2. There are currently three ways.
The change log lets you track all direct modifications a user makes to data in the database. You must specify each table and field that you want the system to log, and then you must activate the change log.
Let’s take a look at How to setup and review Change Logs.
1. Activate the change log
Enter Change Log Setup in Tell me, and then choose the related link.
Check Change Log Activated on the Change Log Setup page.
Turning on the Change Log might slow things down, especially if you are monitoring entities that often change. Do you want to log changes?
Change log will be Activated.
Note: As described in the above warning, depending on the number of monitoring fields and tables you set, activate the change log may reduce the performance of Business Central and greatly increase the usage of the database.
2. Setting up fields Monitoring
Click “Setup -> Table”.
You can specify which tables you want to track changes for, and which changes to track.
If you choose Some Fields. You can open Assist Edit to choose witch fields you want to audit.
After completing the change log settings, click Close.
Note: After you add one or more fields and start monitoring, you must sign out of Business Central and sign in again to apply your settings.
3. Working with Monitoring
Enter Change Log Entriesin Tell me, and then choose the related link.
On the Change Log Entries page, entries are chronologically ordered and show all changes that are made to the values in fields on the tables you specify.
PS: You can use the Delete function to delete unwanted change logs.
You can add filters before deleting, such as Date and Time, Table No., Field No., User ID and so on.
4. Retention Policy (New Feature in BC17)
From Dynamics 365 Business Central 2020 release wave 2, users can define retention policies to specify how frequently they want Business Central to clean outdated data in tables that contain log entries and archived records.
On the Change Log Entries page, click Retention Policy.
Retention Policy of Change Log Entry will be opened.
Or, Enter Retention Policiesin Tell me, and then choose the related link.
Then you can see all retention policies.
You can enable or disable it on Retention Policy page.
Policies can include all data in the tables that is past the expiration date, or they can add filter criteria that will include only certain expired data in the policy.
So if you want to reduce the number of entries you can create a retention policy that will delete entries after a specified period of time.
Auditing Changes in Business Central
Define Retention Policies
Field Monitoring is one of new features on in Business Central 2020 release wave 2 (BC17). You can now define a list of fields that contain high-risk and business-critical data that you want to be notified about when they are changed.
New Update (2020/11/24):
Notify users of high-risk changes in selected setup fields
Changes to high-risk settings in Business Central can be tracked using the Change Log functionality. Sometimes, however, tracking changes is not enough and you expect to be notified of changes in fields that contain high-risk and business-critical data, such as bank account numbers, company name, and addresses.
You can now define a list of fields that contain high-risk and business-critical data that you want to be notified about when they are changed.https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave2/smb/dynamics365-business-central/notify-users-high-risk-changes-selected-setup-fields
1. In BC17.1, you can enter Monitored Fields Worksheet in tell me, and then choose the related link.
2. Add tables and fields you want to monitor, then select the Notify.
3. Choose Field Monitoring Setup action.
Or enter Field Monitoring Setup in tell me.
4. Choose Notification Recipient.
Note: A contact email address must be specified for the user.
5. Click … to review or update the value for Notification Email Account.
Or enter Email Accounts in tell me.
6. If you haven’t added any email, choose Add an email account on Email Accounts page.
7. The Wizard page of Set Up Email will be opened. Choose Next.
Now there are three ways to add email.
7.1 Account Type: Microsoft 365.
Enter Account Name and Email Address, then choose Next.
7.2 Account Type: Current User
Note: Everyone who uses this account must have a valid license for Microsoft Exchange.
Note: You can only use one Current User Email Account at a time.
7.3 Account Type: SMTP
Same as previous settings.
8. After selecting the Notification Email Account, choose Start.
Monitoring fields can impact performance. We recommend that you only monitor fields that contain sensitive data.
Then Monitor Status will be on.
I recommend to log off and log in to BC again.
Then try to modify the monitored field you set.
When you modify the monitored fields for the first time, the following prompt message will appear.
The extension ‘発行元が Microsoft の Email – Outlook REST API’ is making a request to an external service. Do you want to allow this request?
If you choose OK, you will receive the mail for each field.
1. If there is a problem sending the email, you can check the detailed information on Email Outbox page.
2. You can view the mail sending record on Sent Emails page.
3. You can view the log of Field Monitoring Setup and Monitoring Fields on Monitored Field Log Entries page.
4. Enhanced email capabilities are available as a replacement for SMTP Mail Setup.
Excerpt from my blog:
Dynamics 365 Business Central: Enhanced email capabilities and Field Monitoring Setup
Data audit system fields
Data audit system fields is one of new features on in Business Central 2020 release wave 2 (BC17).
Data audit system fields are added to every table
This gives developers an easy and performant way to program against historical data, such as writing AL queries that return changed data since some specified point in time.
Four new system fields are added to all tables:
This is a very useful feature for internal and external audit. Although it can be done with the Change Log feature before, as we all know, the Change Log feature will reduce performance and increase the database capacity. Therefore, in the NAV era that Microsoft did not provide this feature, I believe all partners have manually added this function if customers need.
Sign in to Business Central to check it.
For Example: Customer (18)
The fields has been successfully added to the table(?).
Just in case, I confirmed the system table (Field 2000000041), and they has been added.
|No.||FieldName||Type||Len||Class||Enabled||Type Name||Field Caption||RelationTableNo|
In the previous test, I cannot customize these four fields in AL. Since these fields is stored in the Platform. But now, we can do it.
Note: Although you can add them to the page or report, you cannot modify them because they does not exist in the actual table.
Previous test: For reference only
But as Microsoft said “The platform will populate the content of the fields when a record is created and modified. It isn’t possible for a developer to control the values that are saved to the database.” This feature is stored in the Platform. We cannot confirm these four fields in the standard source code.
For example, we cannot make any changes to them in the development environment.
If we try to create a new customer page or report etc. they cannot be added.
Same as new report:
As of the writing of this article, these four fields cannot be displayed by Design and Personalize.
In summary, we can only directly open the table to confirm Data audit system fields now.
Maybe these four fields are added to better coupling with CDS. For users who only use Business Central, there are still limitations to using it.
Excerpt from my previous blog:
Data audit system fields are added to every table in Dynamics 365 Business Central – Update
I hope this will help.