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

Notifications

Announcements

No record found.

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
    Inge M. Bruvik Profile Picture
    1,105 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

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 3,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans