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.
Is there a way to change this behavior?
Maybe tell the RetailSyncOrdersSchedulerJob batch job to ignore RT if status is /Failed/?
Or another batch jobs to delete the failed RT?
Thanks