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...
Suggested Answer

External Document Number

(0) ShareShare
ReportReport
Posted on by 20

Hi Users,

Is there any standard out of box functionality or configuration which flags when an external document number is entered during the sales order process (this is typically the customer PO number). Whether the sales order entry person at the time of order choose to accept it and go ahead entering the duplicate?

I have the same question (0)
  • Suggested answer
    Ben Baxter Profile Picture
    6,614 Super User 2025 Season 2 on at

    The only setting related to the External Document Number is in the Sales and Receivable setup on whether it is Mandatory or not.

    pastedimage1647005472212v1.png

    Even when it is on, it is only Mandatory when trying to Post the Sales Order.

    There is currently no logic to see if the Ext. Doc. No. entered is a duplicate of one on another Sales Order.

  • Suggested answer
    Vaishnavi J Profile Picture
    3,062 on at

    Hi,

    There is no standard procedure to check whether the external document no is used or not when adding data into the field.

    You can go for customization below is the logic that you can add in page extension of Sales Order.

     modify("External Document No.")

           {

               trigger OnAfterValidate()

               var

                   Rec_CustomerLedgerEntry: Record "Cust. Ledger Entry";

                   Rec_SalesOrder: Record "Sales Header";

               begin

                   Clear(Rec_CustomerLedgerEntry);

                   Rec_CustomerLedgerEntry.Reset();

                   Clear(Rec_SalesOrder);

                   Rec_SalesOrder.Reset();

                   if Rec."External Document No." <> '' then begin  // To check if the external document no is blank or not.

    // To check the external document no is used and posted in customer ledger entry

                       Rec_CustomerLedgerEntry.SetRange("External Document No.", Rec."External Document No.");

                       if Rec_CustomerLedgerEntry.FindFirst() then begin

                           if Confirm('External Document No is used already and it is posted ', false) then

                               Rec.Modify(false)

                           else

                               Clear(Rec."External Document No.");  // If client says no then it clears the filled data

                           exit;

                       end;

    // To check the external document no is used in Sales Header.

                          Rec_SalesOrder.SetRange("External Document No.", Rec."External Document No.");

                       if    Rec_SalesOrder.FindFirst() then begin

                           if Confirm('External Document No is already in used in Sales Order', false) then

                               Rec.Modify(false)

                           else

                               Clear(Rec."External Document No.");

                       end;

                       exit;

                   end;

               end;

           }

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • Suggested answer
    YUN ZHU Profile Picture
    95,574 Super User 2025 Season 2 on at

    Hi, just enable Ext. Doc. No. Mandatory in Sales & Receivales Setup page.

    pastedimage1647221082528v1.png

    Then in sales order.

    pastedimage1647221128268v2.png

    When posting

    pastedimage1647221154376v3.png

    Hope this will help.

    Thanks.

    ZHU

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,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans