Okay, here is a case, I have a restlet, which crea...
# suitescript
t
Okay, here is a case, I have a restlet, which creates orders in netsuite, Now before creating order I check whether the order already exist in netsuite, using PO number I receive in request. Now lets assume I got two parallel request, and both request contain same data(It is happening ), Now when the restlet will run, both instances of restlet will not find any existing order with that PO number and both will create the order, which is why duplicate orders are being made. How can I escape or prevent this scenario ?
I had this in mind, like creating a lock by creating a custom record for that PO number at first, and check whether this PO has been registered or not, but that will face same issue again.
b
if you want to go with a lock, then make sure you read the safe guide first (id start at section 4.6 and 4.7 for details about external id and concurrency issues)
if possible, external id is an easy fix
t
I am sorry, I haven't worked with external Ids before. I will look into this "easy fix".
b
start at the safe guide sections i mentioned
t
Thanks a lot @battk for this. Learned something new today. Worked Smoothly.