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...
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,833 Super User 2026 Season 1 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,094 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
    98,358 Super User 2026 Season 1 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

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,965 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,125 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 961 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans