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...
Answered

After Off the Flag dont want to create Sales order

(0) ShareShare
ReportReport
Posted on by 45

I have created one flag which is "Generic Hold" on customer card when i will make this ON , while creating Sales Order for that particular Customer after selecting Customer no  " you can not create SO because generic hold is ON"

pastedimage1658929812820v2.png

i have tried with this simple code but its not working

tableextension 50006 "Sales order Ext" extends "Sales Header"
{
    fields
    {
        modify("Sell-to Customer No.")
        {

            trigger OnAfterValidate()

            begin
                 rec.SetFilter("Sell-to Customer No.", co."No.");
               
                rec.Find();
                if co."General Hold" = true then begin

                    Error('You cannot create sales order as General hold is on');
                    Message('After');
                end;
            end;
 var
        co: Record Customer;
        so: page "Sales Order";
Kindly Please Suggest 
Thank You
I have the same question (0)
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    You are not getting the customer record in your code.

    You need a co.get(rec."Sell-to Customer.no" there to fget the correct record into you co variable.

    Or else the value of the co."General Hold" will always be false as far as i can see.

  • Pooja Zinjurke Profile Picture
    45 on at

    Thank You this worked

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

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 647 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 447 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 366 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans