BeyondERP.Newsletter
Menu

Setup step on the Clean up email notification logs page · Retail and Commerce

Clean up email notification logs

Delete notification log records older than the retention you set.

See how to set it up Back to Retail and Commerce

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 isA batch job that deletes email notification log records older than a set number of retention days.
What you do hereUse this page to schedule regular removal of old email notification logs, optionally including emails that were never sent.
ExampleFor 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.
Clean up email notification logs page in Dynamics 365
The page in Dynamics 365. page title tab to open what to set or check
Functional consultant · Solution architect

2Where it fits

End user · Functional consultant

3How to do it

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 itOnce order email notifications are running and the email notification logs keep growing; set it up together with the email notification job.
How oftenRecurring with no end date; Learn's example runs it every three months.
Batch settingsA 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 showsFewer 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.

Source: Microsoft Learn

Setup steps on this page

Clean up email notification logs

Delete notification log records older than the retention you set.

Steps from Microsoft

  1. Go to Retail and Commerce > Retail and Commerce IT > Email and notifications > Clean up email notification logs.
  2. In Retention days, enter how many days email logs are kept. The job deletes only emails older than that.
  3. 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.
  4. 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.
  5. If each subtask should delete more or fewer than 2,000 logs, change NotificationLog_NumOfRowsToBeCleaned in Commerce shared parameters > Configuration parameters.
  6. 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).

Source: Microsoft Learn

Fields on the page

FieldWhat it means
Also delete unsent emailsWhen Yes, the job also deletes emails that were not sent successfully.Microsoft Learn
Retention daysHow many days emails are kept before the job deletes them.Microsoft Learn

Common errors and fixes

MessageWhat to do
Unsent emails disappear from the logAlso delete unsent emails was selected. Clear it, and investigate unsent emails before the next cleanup. Microsoft Learn

Test checklist

  1. No email log older than Retention days remains.
  2. Unsent emails are kept or deleted as set in Also delete unsent emails.
  3. The batch job history shows the subtasks finished without errors.

Source: Microsoft Learn

Functional consultant

4Setup decisions

Setup stepRecommended value and whyDecision, common mistake and test
Clean up email notification logsSchedule 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.How many days of logs should be kept?Selecting Also delete unsent emails without checking why emails are unsent.Test: Old logs are deleted
Solution architect

5Design impact

Shared or per companyPer company: each legal entity has its own records. Microsoft data model
Can it be undoneIrreversible: Deleted log records can't be restored.
If you change it laterThe job keeps creating subtasks, each deleting up to 2,000 logs by default, until no qualifying logs remain. Microsoft Learn
Technical architect

6Technical

Menu itemRetailEventNotificationLogCleanUp Checked in Dynamics 365
FormSysOperationTemplateForm Checked 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
Developer

7Developer

Open it by URLhttps://<your-environment>/?mi=RetailEventNotificationLogCleanUp
Data migrationLoad 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
Everyone

8Sources

To cite this step: RC-ITJ-110, Clean up email notification logs. Beyond ERP Atlas Hub. https://www.beyonderp.cloud/atlas/step/RC-ITJ-110