web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Do not retry the synchronization on already failed retail transactions

(1) ShareShare
ReportReport
Posted on by 38

Context

We are creating sales order in F&O from Commerce (we have a custom website that calls Commerce using the CSU OData APIs).
Here's the flow:
- Create and checkout a Cart in Commerce using the CSU OData APIs
- A batch job /P-0001/ creates a retail transaction from the Commerce cart
- A batch job RetailSyncOrdersSchedulerJob then create a sales order in F&O from the retail transaction.
 
//
 
Sometimes, the RetailSyncOrdersScheduler job cannot create a sales order because of rules in F&O that prevents it. For example: /Product ABC123 is on hold/.
The retail transaction status is now /Failed/. This is fine for us, we can detect the error and send an email to our internal staff to handle the order manually (create a new one without product ABC123, call the customer, etc).
 
//
 
The real problem here is that the job RetailSyncOrdersSchedulerJob continues to try over and over again to create a sales order from that RT (see the /retry count/ on the screenshot). So, if a week later, product ABC123 is no more on hold, the sales order will be created in F&O. But we don't want this, because we already handled this.
 

Workaround

For now, I found a quick & dirty workaround.
 
I have a program listening the RT created in data entity RetailTransactionsAuditable and detects the new ones with status /Failed/. When a new one is detected, I set its status to /Editing/ to prevent the batch job to retry it as it's mentioned here
 
in the Pending order status field, enter Editing, and then publish the change. In this way, you prevent the Synchronize order job that is running in batch mode from skipping this record during processing
OData request:
 
PATCH /data/RetailTransactionsAuditable(dataAreaId = 'foo', OperatingUnitNumber = 'bar', StoreNumber = '', RegisterNumber = '', TransactionId = 'baz')?cross-company=true{    /AsynchronousOrderStatus/: /Editing/}
 
But it's a dirty solution. And sometimes it doesn't work because a job can run and retry the RT before this update request is done.
 

Question

So my question is: is there a way to tell the RetailSyncOrdersSchedulerJob batch job to not retry /Failed/ retail transactions?
I guess some X++ code inheriting the default job might work but we try to avoid writing custom code in the ERP.
 
 
I have the same question (0)
  • Suggested answer
    Shafeeque P. Profile Picture
    6,533 Moderator on at
    I think X++ is the best option. Making Odata queries frequently to check if there are any failed transactions adds to unwanted resource utilization. If MS enforces API throttling in future, this might fail. 
     
    Extend RetailTransactionsAuditable  job to validate the number of retries (process only orders that retry count less than or equal to 3) before it tries to sync that order. 
  • Suggested answer
    Shafeeque P. Profile Picture
    6,533 Moderator on at
    Also, please post an idea to have "maximum retry control on the batch job. I will definitely vote.
  • Shafeeque P. Profile Picture
    6,533 Moderator on at
    Request to read "RetailTransactionsAuditable" as "RetailSyncOrdersSchedulerJob" in the previous comment. Hope MS will bring back edit the answer/comment soon :)
  • JuniorD Profile Picture
    38 on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 130 Super User 2026 Season 1

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 92 Super User 2026 Season 1

#3
Zain Mehmood Profile Picture

Zain Mehmood 89 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans