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.
Regards,
Faiz
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.
Regards,
Faiz
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.
"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
- "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.
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
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.
Please help me..
Regards,
Faiz
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.
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?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156