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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Sales order approval when unit cost on a item is zero

(3) ShareShare
ReportReport
Posted on by 497
Hi,
 
We need to setup a sales order approval for a order at release status. If item line has a zero unit cost or is more than the sales price, the order must be sent for approval before the invoice can be posted 
 
How to set this up
 
Many thanks
I have the same question (0)
  • Suggested answer
    TarikJerkovic Profile Picture
    354 on at

    Hi,

    This cannot be configured fully with the standard approval workflow because the condition is based on Sales Line values and compares unit cost with sales price.

    A small AL extension is needed to:


    • Check whether Unit Cost = 0 or Unit Cost > Unit Price

    • Mark the sales order as requiring approval

    • Block release or posting until approval is completed

    Also confirm whether the comparison should use the unit price before or after discounts.

    Kind regards

    Tarik Jerković

  • Suggested answer
    YUN ZHU Profile Picture
    102,765 Super User 2026 Season 2 on at
    As far as I know, standard workflows cannot handle this; you can set conditions for the header, but not for the line items.
    You might consider a customization or using Power Automate to achieve this.
     
    Thanks
    ZHU
  • Suggested answer
    OussamaSabbouh Profile Picture
    18,722 Super User 2026 Season 2 on at
    Hello,
    This cannot be configured fully with the standard Sales Order Approval Workflow, because workflow conditions are mainly based on the Sales Header and do not evaluate every sales line to check whether Unit Cost = 0 or Unit Cost > Unit Price. You will need a small AL customization that checks the sales lines when the user releases, posts, or requests approval; when any item line meets either condition, the extension should require approval and block release/posting until it is approved. The standard workflow can still manage the approver and approval process, while the customization provides the missing line-level condition.
    Regards,
    Oussama Sabbouh
  • Suggested answer
    Teagen Boll Profile Picture
    3,567 Super User 2026 Season 2 on at
    You can just use the standard SO approval for the scenario where the Unit Cost = 0
     
    Below is an example, if you have an SO and if any lines on that SO have a 0$ unit cost then it goes for approval:
     
    If you want a check for Unit Cost > Unit Price I would just add a calculated field to the Sales Line that performs that check. Then add that field as a filter in a Sales Order workflow. You would have 1 workflow with the filter above and another for the new check field.
     
    Best,
    Teagen Boll
    Social: LinkedIn
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    3,055 Super User 2026 Season 2 on at

    Hi, the mechanics of the approval you get for free. Take the MS sales order approval workflow template, set the approver in Approval User Setup, and once the order goes to Pending Approval nobody can release or post it, so the posting side is covered.

    What standard can't give you is the trigger. Workflow event conditions are plain record filters on the sales header, and what you describe is a line check plus a comparison between two fields, so there is no way to put it in the setup. It needs an extension, and I'd do it as a custom workflow event that walks the lines and raises the approval request. Careful with the obvious shortcut though, if you create the request in a subscriber and then throw an Error to stop the release, the rollback takes the request away with it. Better to block release with a message asking the user to send it for approval, or handle the release event, start the workflow and come out without an error.

     

    Glad to help - follow up if anything is unclear.   

    ►  If this solved it, marking it verified helps others too.       

    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 575 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 430 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 334 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans