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 :
Small and medium business | Business Central, N...
Unanswered

Confirm dialog exit sales order when condition not met

(0) ShareShare
ReportReport
Posted on by 1,165

Hi All,

On sales order release we have validation to check amount as below, all works when amount is greater meaning condition met and user blocked , however when amount (in this example less than 10000) and user releases the sale order, sales order screen closes after release. We want to have the default system behavior if the amount is less than 10000, and sales order screen stays open after release.

 ---------

    local procedure MyProcedure(var SalesHeader: Record "Sales Header")
    var
        Text001: Label 'Amount Over 10000 - Confirm Yes to Release or No to go back to Order';
        Text002: Label 'Not Released. Change Amount if required and release again';

    BEgin


        SalesHeader.GET(SalesHeader."Document Type", SalesHeader."No.");
        SalesHeader.CALCFIELDS(Amount);
  
                IF (SalesHeader.Amount > 10000) THEN
            IF NOT CONFIRM(Text001) THEN
                ERROR(Text002);

    End;
  • JAngle Profile Picture
    159 on at

    You certain it closes or are you in a filtered view at the time? None of the code would perform a page close. I presume your procedure is called from an event subscriber for release of a sales order?

  • Anita75 Profile Picture
    1,165 on at

    Thanks this is run from a code unit as below:

    codeunit 60109 CheckSalesOrderAmount

    {

       EventSubscriberInstance = StaticAutomatic;

       [EventSubscriber(ObjectType::Codeunit, Codeunit::"Release Sales Document", 'OnBeforeManualReleaseSalesDoc', '', true, true)]

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 August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 753 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 583 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 302 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans