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 > 10000THEN
            IF NOT CONFIRM(Text001THEN
                ERROR(Text002);

    End;
I have the same question (0)
  • JAngle Profile Picture
    150 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans