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

Community site session details

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

Retry count for sales order invoicing

(1) ShareShare
ReportReport
Posted on by 6,527 Moderator
We have a batch job configured to automatically invoice sales order lines those are in packing slip. Due to some reason(missing financial dimensions, payment not captured) the invoicing of specific lines fail. These are lines are again picked by  the next recurrence of the batch job. Does sales order/line has any field where the number of retries attempted is recorded, so that we can use it to exclude it from batch job after a certain number of retries. Or are there any configuration to avoid spending system resources on orders that is meant to fail. 
I have the same question (0)
  • Suggested answer
    Adis Profile Picture
    5,694 Super User 2025 Season 2 on at
    Retry count for sales order invoicing
    Hi,
     
    There is no check to it. When you set up the batch job, there is are filters you can set in the standard dialog that pops up, if you are lucky you could set conditions there, so that only lines are being processes that meet these conditions. I dont think fin. dimension are to be filtered, but its something to check.
     
    The way I would implement it is to use Power Automate to capture all lines that are not invoices. The Power Automate flow would run after the batch job. Then the flow would send emails to the responsible persons to fix the missing information. I dont know if that would fit to your process, since I dont know details, but it would be an idea. It could be that you need to adjust or create entities in order to catch all the information in Power Automate, but those are minor development tasks.
     

    Kind regards, Adis

     

    If this helped, please mark it as "Verified" for others facing the same issue

    Keep in mind that it is possible to mark more than one answer as verified

  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,179 Super User 2025 Season 2 on at
    Retry count for sales order invoicing
    Hi Shafeeque,
     
    Sales order lines/headers do not have the mechanism to capture number of retries. You can override the number of retries on the batch by using the SysOperation Framework and having your batch re-trigger at the line through isRetryable() method. Recommended number of re tries suggested by Microsoft is 3 to 5, depending on the data volume handled by the batch.
     
    As Adis mentioned, you can consider using business events with Power Automate where you can have the batch re-run post number of re-tries and then automate or requeue the failed batch jobs through the PowerAutomate or custom APIs. 
     
    The business events with PowerAutomate alternative suggestion is explained in detail, in the documentation for Batch Odata APIs.
     
     
    References:
     
    Hope this helps. 
  • Suggested answer
    Zain Mehmood Profile Picture
    4,173 Most Valuable Professional on at
    Retry count for sales order invoicing

    Hi,

    There’s no out-of-the-box field on the sales order or sales line that tracks the number of invoice retry attempts. The batch job simply picks up eligible lines each run, and failed ones are retried again unless filtered out manually.

    To handle this, a common approach is:

     

    Custom extension – Add a retry counter field on the sales line or a related table via extension. Increment this field each time the line fails invoicing (via post-processing logic or custom error handling in the batch).

     

    Filter logic – Modify the query in your batch job to exclude lines that exceed a retry threshold.

     

    Error logging – Use the standard "batch job history" or create a custom log table to track failed lines and reasons, helping you analyze patterns or exclude problematic data.

    There’s no standard configuration to exclude permanently failing lines, so a controlled customization is the practical way forward.

    Hope that helps.

    Zain

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 865

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 289 Super User 2025 Season 2

#3
Sagar Suman Profile Picture

Sagar Suman 230 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans