Hi All, I'm to get your input for :- if triggerin...
# suitescript
d
Hi All, I'm to get your input for :- if triggering scheduled script on demand is a best practice or not? I have a requirement where I should trigger a scheduled script on creation of sales order? If customer creates multiple sales orders lot of scheduled scripts will be added to queue so wanted your thoughts on this. I don't want to write my logic in after submit for this because it is interfering with other business processes instead I want to trigger schedule script from AS
b
should be fine
the most simple approach is to put one scheduled script into the queue for each sales order
can make the scheduled script queue full of scripts
if you want to limit the number of scripts in the queue, or want to implement better error handling
then make a custom record for each of your sales orders and have a scheduled script (or map reduce) process all of the custom records
you can have that script run every 15 minutes to do the processing
or you can have one script deployment and dynamically schedule that script using a task
if its already in the queue, then dont try to schedule a new one
you can do both if you have a strategy to handle concurrency
depending on your needs, you may be able to get away with using custom fields on the sales order instead of using a custom record
d
Sure makes sense @battk
@battk I triggered scheduled script from UI worked perfectly for some orders but for one order the page got hanged and threw a record_Has_Changed error
b
record has changed is somewhat normal
hanging is not
record has changed means that something changed the record between when it was loaded and when it was saved
can be common on accounts that have empty queues and workflows that changed the record after record submit