Hi all. On the Project Record, we have an afterSub...
# suitescript
n
Hi all. On the Project Record, we have an afterSubmit UE on create that updates a field to build out a unique string that includes the project ID. The problem we are running into is if the Project Template takes a while, we get this error: "[ProjectName] is under construction!". To solve this, we add in a little bit of code to delay but it seems like 30 seconds is the shortest time that it will consistently work. Obviously our users are complaining that they have to wait 30+ seconds from a project to commit to the database. Any tips?
b
use a ScheduledScriptTask to run the update later
you may also want to use a map/reduce script if you just want to run the update logic on a schedule
n
thanks. I think our challenge is that we need it to happen as soon as the project is submitted. I'm surprised that the Project Number is generated AFTER all related Tasks have been generated.