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?