Is it possible that 2 deployment of same script wh...
# suitescript
a
Is it possible that 2 deployment of same script which is creating customer payment potentially create the duplicate payment ?
b
not really enough information given, the answer is yes
a
I have multiple deployment on map reduce script
b
you can write a script the creates duplicate payments
a
which being called through task api from another map reduce script
since it is taking longer time to complete which is being executed
2nd deployment also got triggered
logic in script consider the saved search data
I am guess same invoice getting processed at similar time and it is getting created since invoice is open
@battk even though their isn't any amount which remained for apply ?
b
not enough information given about the script deployments nor the code
ill simply confirm that it is possible to make scripts that create duplicate payments
a
how duplicates ?
s
NS doesn’t prevent duplicates. it’s that simple
Until a payment gets saved and applied, the amount remaining will still be greater than zero. Best thing is to check the amount remaining at the very last step, right before saving the payment, and abandon saving it if the amount remaining has decreased or is zero.
a
Aha
s
But even then, there is still a small chance you can still create duplicates, you can’t 100% prevent it if two or more deployments are running at the same time.
a
got it
thanks for confirmation
I was thinking the same
simplest way for me to un deploy the multiple deployment
s
That’s the safest route
👍 1
z
Try with an externalID for each payment. externalID need to be "calculated" from the source data