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

Notifications

Announcements

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
    137 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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,594

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,594

#3
YUN ZHU Profile Picture

YUN ZHU 748 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans