Hi. We have a custom field called “custitem_no” on...
# suitescript
j
Hi. We have a custom field called “custitem_no” on our inventory items. We need that to be unique across all items (empty is fine though). Can someone help me write the UE script to prevent duplicates?
b
if you dont expect 2 items to be saved at the same time, then you can get away with a before submit entry point that does a search or query on items to make sure your items's custitem_no doesnt exist yet. if it does, throw an error
if you need it to work with concurrent saves, then i recommend instead creating a custom record with an external id set to the custitem_no
rely on the external id instead to guarantee uniqueness
will require logic to find the original custom record and edit it if the custitem_no changes