i have a before submit user event script that sets...
# suitescript
b
i have a before submit user event script that sets a prefix on the PO# for PO's that match certain criteria (custom Order Type field value = Retail). in order to do this, i had to allow override on PO#'s. the script double checks the max numeric portion of the PO# on any other existing PO and increments it to ensure uniqueness. however, two were simultaneously created via web services, resulting in a duplicate PO# on two transactions. - SuiteAnswer Id 73172 [1] says to enable Duplicate Detection Warnings, but I don't think this helps via web services. - SuiteAnswer Id 43487 [2] says that via CSV import, it will throw an error if a duplicate PO# is specified. however my scenario isn't via CSV, and it isn't the request that's setting the PO#, it's the script. Unfortunately I don't think an after submit script will work, since PO's are immediately emailed to the vendor at time of creation, and I fear changing the PO# would cause confusion and discrepancies in transacting with the vendor. I'm thinking I need a semaphore / lock to prevent a PO from being processed if another has started but not finished. does anyone agree/disagree or have suggestions? [1] https://netsuite.custhelp.com/app/answers/detail/a_id/73172/kw/duplicate%20override%20transaction%20number [2] https://netsuite.custhelp.com/app/answers/detail/a_id/43487/kw/duplicate%20override%20transaction%20number