Updating Document Number Prefixes: Historical and New Transactions

To change the prefix of a document number in NetSuite for both future and existing records, you can follow this structured and safe process:

Disable Advanced Numbering (if enabled)

  • Navigate to: Setup > Company > Setup Tasks > Auto-Generated Numbers
  • Uncheck the “Use Advanced Numbering” checkbox.
  • Click Save.

Enable “Allow Override”

  • Still in the Auto-Generated Numbers page:
  • Check the “Allow Override” checkbox for the relevant transaction type (e.g., Invoice, Sales Order).
  • This allows you to edit numbers manually or via script for existing records.

Update Existing Records

We have two options:

  1. Manual Update (for small volumes):
  2. Open each transaction.
  3. Change the document number manually to include the new prefix (e.g., from INV123 to NEW-INV123).
  4. Map/Reduce Script (for bulk updates):
  • Use a Map/Reduce script to safely bulk-update historical records. Here’s a brief logic flow:
record.submitFields({
    type: record.Type.INVOICE,
    id: invoiceId,
    values: {
        tranid: 'NEW-' + currentTranId
    }
});

Revert “Allow Override” Setting

Once all historic transactions are updated:

  • Go back to Auto-Generated Numbers
  • Uncheck the “Allow Override” option for the transaction type.
  • Click Save.

Re-enable Advanced Numbering (optional but recommended)

  • Check the “Use Advanced Numbering” again.
  • Click Edit next to the transaction type and configure:
  • Prefix (e.g., NEW-)
  • Minimum digits
  • Suffix or date-based components (if needed)
  • Save the rule.

Leave a comment

Your email address will not be published. Required fields are marked *