Retail and CommerceRetail and Commerce ITEmail and notifications
RetailEventNotificationLogCleanUp
Used by
System administrator
Business process
Create B2C eCommerce sales channel in Dynamics 365 Commerce
Menu item
RetailEventNotificationLogCleanUp
Setup steps
1 on this page
How this guide was checked
Checked in Dynamics 365
Version 10.0.49: the menu item, form, table and security, the page.
Recommended values
Based on Microsoft's documentation. A sound starting point to adjust to your own business requirements.
Tests
A ready-to-run test, “Old logs are deleted”, to confirm this setup in your own test environment.
Show what matters for
SETUP GUIDEHow to set it up8 sections. Choose a role to highlight what matters to you.
Everyone
1What it is and why
What it is
A batch job that deletes email notification log records older than a set number of retention days.
What you do here
Use this page to schedule regular removal of old email notification logs, optionally including emails that were never sent.
Example
For example, BEAT keeps 90 days of notification logs. The job runs every Sunday and deletes about 40,000 older entries, so the log stays quick to search.
The page in Dynamics 365. page title tab to open what to set or check
About the examples: Examples and screenshots in this guide use BEAT, a demo company in a Dynamics 365 test environment. Use your own company's codes and values instead of copying them.
When to run it
When to run it
Once order email notifications are running and the email notification logs keep growing; set it up together with the email notification job.
How often
Recurring with no end date; Learn's example runs it every three months.
Batch settings
A recurring batch job with no end date. Each run keeps creating subtasks of up to 2,000 logs each until no qualifying logs are left.
What the output shows
Fewer email notification log records: logs older than Retention days are gone, and so are unsent emails when that option is Yes. If old entries remain, they are usually unsent emails kept because Also delete unsent emails is No.
Delete notification log records older than the retention you set.
Steps from Microsoft
Go to Retail and Commerce > Retail and Commerce IT > Email and notifications > Clean up email notification logs.
In Retention days, enter how many days email logs are kept. The job deletes only emails older than that.
Set Also delete unsent emails to Yes if emails that weren't sent successfully should be deleted too; leave it No to keep them in the log.
Select Recurrence and set the pattern, for example Months with Count 3 to clean up every three months, and select No end date to keep the job running.
If each subtask should delete more or fewer than 2,000 logs, change NotificationLog_NumOfRowsToBeCleaned in Commerce shared parameters > Configuration parameters.
After a run, open the email notification logs and check that no entries older than the retention days are left (apart from unsent emails, if you kept them).
Schedule it as a recurring batch job with a retention, in days, that covers customer service questions.The log grows with every order email; old entries are rarely needed.
Irreversible: Deleted log records can't be restored.
If you change it later
The job keeps creating subtasks, each deleting up to 2,000 logs by default, until no qualifying logs remain. Microsoft Learn
Technical architect
6Technical
Menu item
RetailEventNotificationLogCleanUpChecked in Dynamics 365
Form
SysOperationTemplateFormChecked in Dynamics 365
Who can open it
1 security role.
No privilege grants this menu item, so no duty or privilege can give access to it. Only the System administrator role, which is not limited by security, can open it.
RoleSystem administrator-SYSADMIN-
Worked out from Microsoft's standard security definitions (10.0.2790.108), which hold every privilege of the working Dynamics 365 system (10.0.49) but one custom privilege, checked on 2026-11-23
Load order: Clean up email notification logs has no data entity in Data management, so it can't be loaded from a file or a configuration template. It works on data that is already in the system, so there is nothing to load.Checked in Dynamics 365