Proposal Summary
This proposal describes the process of solving the Sales order number duplication by using the Custom records.
Requirement
Bloom & Grow facing an issue of duplicating the Sales order number and need to generate unique numbers to identify each Sales order.
We have an existing User Event script which is used for replacing the Sales Order number by incrementing the current largest transaction number and adding a prefix to it.
Currently the script is deployed to Sales orders, Invoice and Credit note records, and is working in the before submit of the following contexts.
- When creating a Sales order, Invoice and Credit note through User Interface (UI)
- When creating an Invoice through User Event / Suitelet
- When creating a Sales order through the Web service
- When creating a Sales order/ Invoice through CSV Import
- When creating a Sales order through the User event
The script will trigger in the after submit
- When creating a Sales order through Webstore
Attaching the link of the existing script deployment below.
Script Deployment – NetSuite (Bloom & Grow Ltd)
For Example,
If the Sales order Number is SO-AU-254678 and the Internal ID of Custom record is 300123, then we will update the Sales order number as follows.
SO-AU-300123
We will remove the last digits after the hyphen (-) from the Sales order number and replace it with the internal id from the custom record in the before submitting of the record.
Once the Sales order number is updated, we will delete the custom record entry by using the same script.
Our Solution
We will be implementing a new solution by creating a User Event script and use the custom records to generate unique numbers to replace this tranid and will resolve the duplication in Sales order number.
We will create a custom record named “SO Serial Numbers” and will add two fields named “Internal ID” and “Name” to it. We need to set a 6-digit number as the initial number in the custom record.
The entry to the custom record will be created only when we generate a new Sales order in NetSuite. Then the script will fetch the Internal ID of the current custom record and will replace the last digits of the Sales Order number with this Internal ID.
We will update the script in the following scenarios
- Creating a Sales order through User Interface (UI)
- Creating a Sales order through the Web service
- Creating a Sales order through CSV Import
- Creating a Sales order through the User event
- Creating a Sales order through Webstore
Assumptions
- There will always be only one entry on the custom record.
- The custom record will always contain unique numbers.
- Script will trigger only in the create mode of the Sales order record.
- We will not update anything while creating the Invoice and credit note.
- We will not give any restriction to the subsidiaries and for the roles.
- We will only consider the Sales order record and will not consider Invoice and the Credit note.’
- We will remove the Sales order from the current script deployment.
- We will not apply the Invoice and the credit note in the updating version
Risks
- We will not apply this custom record to Invoice, Credit notes and the Purchase Order. So, there may be chances of using the same transaction number for both Sales order and other transactions (Invoice, Credit note, Purchase order etc). But the only change is that we will add a prefix before the sales order number.
- We will start the custom record with the last existing sales order number in the production.
- We are assuming that the solution will be handled by NetSuite.