Quick question. Creating a Sales Order from SuiteScript and I'm getting a DUP_RCRD error. I'm not setting an externalid and the tranid is set to autogenerate. Does anyone know what the cause might be?
j
jen
10/08/2025, 3:30 PM
Can you post your code?
p
Pandorahiccup
10/08/2025, 8:21 PM
That error usually means something in the record is creating a duplicate reference even if externalid and tranid are not set. Please check if the script or another process is trying to create the same order twice or if there is a unique field like a custom external id being reused.
d
Daryl K
10/08/2025, 10:53 PM
The script works for some Customers, but not others. It only creates a basic sales order with a single item (for later processing).
p
Pandorahiccup
10/09/2025, 1:22 PM
If it only fails for certain customers, there might be a duplicate transaction already tied to that customer. Try checking if a pending or identical Sales Order exists for them, since NetSuite can block new ones with matching references or identical data.