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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Want serial number will be same as Sales order number

(0) ShareShare
ReportReport
Posted on by 2,382

Hi Experts,

Can I make serial number to generate same as Sales order number in Sales order Form. As given below screenshot.

Please suggest how or it can been only by X++ job or any other way.

1581.SO.jpg

Regards,

Faiz

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Hi faiz7049,

    what's the business requirement behind this? If you just want to track where each item (serial number) was sold, you can do it without changing the logic for serial number creation.

    Anyway here's how you should be able to achieve it without any customization:

    1) Make sure that number sequence for Serial numbers is set to Manual

    2) Right click the Serial number field -> Go to details.

    3) Create a serial number that mathces the Sales order number

    4) Go back to Sales order form, select the newly created serial number

    If you would like to develop something that would do it automatically, you would need to consider few things:

    - What is the exact moment in time when the new serial number should be created?

    - What should happen if you need to sell two pieces of the same Item id on one Sales order?

  • Suggested answer
    axk Profile Picture
    925 on at

    The system supports the process of the serial number auto-generation, but it does not support the sales orders. But if you want the serial number to be the same as the sales order number it has to be customized anyway.

    As Nikolaos mentioned, you will probably need to customize the process of inserting the sales order line. When it is created, you have to add the combination of ItemId and InventSerialId into the InventSerial table and assign the newly created serial number to the sales order line.

    Be aware that if you want to sell the specific serial number, you have to have the available stock on this serial number. If not, you will have to create transfers to be able to complete the picking and delivery.

  • faiz7049 Profile Picture
    2,382 on at

    Hi Nikolaos Mäenpää,

    Requirement is after Finished Goods come to inventory (on-hand form). It should show Serial number same as Sales order number(Production reference is Sales order.

    What is the exact moment in time when the new serial number should be created?

    Serial number should fill automatically once line item added to Sales order form same as Sales order Id.

    What should happen if you need to sell two pieces of the same Item id on one Sales order?

    Just to track that on on-hand form that this Finished goods reference to this sales order.

    7266.SO.jpg

    1346.SO1.JPG

    Please help me..

    Regards,

    Faiz

  • faiz7049 Profile Picture
    2,382 on at

    Hi Experts,

    I got logic to get serial number same as created sales order id.

    I just want to know which are best practice either onclick() method or init() method in form level.

    Regards,

    Faiz

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    - "init on form level" -> how would you know for which item you need to create the serial number? 

    - "click on form level" -> there's no click on "form level", so you would need to first clarify what you mean by it.

    My suggestion is to create the serial number when the user selects the item id. For this there already exists itemIdModified method in SalesLine data source of SalesTable form.

    Don't forget to delete the serial number if the user deletes the order line or the whole order.

  • faiz7049 Profile Picture
    2,382 on at

    "init on form level" -> how would you know for which item you need to create the serial number?

    Checking if item (Product) type=BOM.

    click on form level" -> there's no click on "form level", so you would need to first clarify what you mean by it.

    Using button but this is not automatically.

    Let me check all possibilities .

    regards,

    Faiz

  • Suggested answer
    axk Profile Picture
    925 on at

    During the form or even data source init() method execution you are not able to get any information about the ItemId, which is necessary to create the InventSerial record.

    You have to execute this logic once the ItemId is set as Nikolaos wrote.  You will probably also have to handle the scenario when the SalesLine is created from X++ code, not by form, so you can check the SalesLineType class and the createLine() method.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans