Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Sales order number and Purchase order number as the same

(0) ShareShare
ReportReport
Posted on by 89

Hi Members,

Suggest me a solution to get the same sales order number to the purchase order number ( i.e If I am assigning a sales order number to be 19999, I need to get the same number as the purchase order number). Please help me out by providing a proper solution to this.

7103.Untitled.png

Thanks and Regards,

Janarthanan V

  • Suggested answer
    Amit Baru Profile Picture
    3,029 on at
    RE: Sales order number and Purchase order number as the same

    Hi,

    At the time of Creating PO from SO, simply assign the SO No. to PO No. & If you want Create PO then use the default No. series functionality of system.

    Regards

    Amit Sharma

    www.erpconsultors.com

    www.linkedin.com/.../

    Pls press Yes if info is useful.

  • Janarthananv Profile Picture
    89 on at
    RE: Sales order number and Purchase order number as the same

    Dear ZHU,

    I would like to explain you that my requirement is as follows.

    1. If I am creating a purchase order through the sales order, the purchase order number that is being generated must follow the customization that I had done in the no. series.

    2. If I am creating a purchase order ( Directly ), then at this time, the purchase order number that is being generated must follow the default number series pattern that had been set earlier in the no. series.

    The difference between my requirements is that direct purchase order number must follow the default no. that had been set in the no. series and the purchase order that had been created from the sales order must follow the customized no. that had been set in the no. series.

    Please provide me an appropriate solution for solving my problem.

    Thanks and Regards,

    Janarthanan V

  • Suggested answer
    Gabriel Prinz Landeo Profile Picture
    35 on at
    RE: Sales order number and Purchase order number as the same

    Hello recently I made a similar development, in which I used the native function, to replicate it in another function and add the relationship of the sales order to the purchase order then add this to supplier movements and accounting movements so that the relationship that is born from a sales order appears.

    What I recommend is to enter the Objet designer

    This is the native action of the sales order page

    action(CreatePurchaseOrder)

                       {

                           ApplicationArea = Suite;

                           Caption = 'Create Purchase Orders';

                           Image = Document;

                           Promoted = false;

                           //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'

                           //PromotedCategory = Category8;

                           //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'

                           //PromotedIsBig = true;

                           ToolTip = 'Create one or more new purchase orders to buy the items that are required by this sales document, minus any quantity that is already available.';

                           trigger OnAction()

                           var

                               PurchDocFromSalesDoc: Codeunit "Purch. Doc. From Sales Doc.";

                           begin

                               PurchDocFromSalesDoc.CreatePurchaseOrder(Rec);

                           end;

                       }

    the native code unit is : codeunit 1314 "Purch. Doc. From Sales Doc."

    In this codeunit you can insert in the header of your order or purchase invoice a relationship that you can choose already established in your sales order

    Nice to meet you

    Kind regards

    Gabriel Prinz

  • AD-22040756-1 Profile Picture
    638 on at
    RE: Sales order number and Purchase order number as the same

    the question reminds me of this:

    pastedimage1660958487598v1.jpeg

    as other have said this is not a good idea - and to expand on this its not good in terms of an audit trail as well. Lets say your auditor comes and asks to see posted purchase invoice no. 101103 or to see the general ledger entries for this purchase invoice. Assuming both the sales and purchase invoice are posted on the same date, you're going to go to your GL and pull up entries for both the purchase and sales invoice? There is a reason each document needs a unique number. 

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Sales order number and Purchase order number as the same

    In a multi user environment with several people working with sales order creating a solution where you base it on number series being in sync will never work in the real world.

    Then you at least would need separate  number series pr. user. And even that will be hard to maintain. One sales order being deleted or on PO being deleted and you are out of sync.

    I could really not recommend that approach.

  • Suggested answer
    YUN ZHU Profile Picture
    86,125 Super User 2025 Season 1 on at
    RE: Sales order number and Purchase order number as the same

    Hi, If you don't want to customize, you need to ensure that the Last No. Used of the No. Series used in SO and PO is consistent.

    pastedimage1660869293015v1.png

    Hope this helps as well.

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Sales order number and Purchase order number as the same
    [quote user="Janarthananv"]

    Dear Inge M. Bruvik,

    I have attached the image in the question along with the description and please provide me an appropriate solution by reffering to that

    Thanks and Regards,

    Janarthanan V

    [/quote]

    Hi,

    I fully understand what your requirement is, and this can be achieved pretty simple in code. For the standard flow. In it simplest form you can manually change the purchase order number to be what ever you want it to be after the PO is created.

    The thing is that i would not recommend that you implement such a function because it has some consequences for the rest of the system that can be hard to realize at first. And it might get you into a situation where you want start using new functionality in the future that this customization will prevent you from using.

    The standard functionality gives you a perfectly good relation between a sales order and a purchase order that you can use for reporting and to follow up both on your customers and your vendors. 

    That is why i am trying to urge you to really understand the standard functionality before you decide that it does not fill your needs and you will need a customization for it. 

  • Alfredo_Iorio Profile Picture
    1,260 on at
    RE: Sales order number and Purchase order number as the same

    It looks like Inge has provided the right solution for your requirement.

    The standard functionality for drop shipments enables the link between a purchase and a sale.

    There is no standard feature to get the same document number on two different documents. Why do you need that?

    Keep in mind that in some countries, maintaining a correct numbering sequence for business transactions is required by the law.

    You can change the document numbering through code. But that might breach compliance and get into trouble with a financial audit.

  • Janarthananv Profile Picture
    89 on at
    RE: Sales order number and Purchase order number as the same

    Dear Inge M. Bruvik,

    I have attached the image in the question along with the description and please provide me an appropriate solution by reffering to that

    Thanks and Regards,

    Janarthanan V

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Sales order number and Purchase order number as the same

    Sorry, here is the link also for drop shipment.

    docs.microsoft.com/.../sales-how-drop-shipment

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June 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 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans