Skip to main content

Notifications

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?

  • Suggested answer
    YUN ZHU Profile Picture
    84,555 Super User 2025 Season 1 on at
    RE: External Document Number

    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

  • Suggested answer
    Vaishnavi J Profile Picture
    3,060 on at
    RE: External Document Number

    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
    Ben Baxter Profile Picture
    5,819 Super User 2025 Season 1 on at
    RE: External Document Number

    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.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans