When returning `false` from `saveRecord`, do the r...
# ask-stanley-ai
p
When returning
false
from
saveRecord
, do the rest of the deployed CS scripts (not only mine, but all the rest not yet executed) still run or does the entire process stops immediately after I return
false
? Do all CS entry points that return false have the same behavior?
c
AI generated answer (using internal Slack threads):
When returning
false
from the
saveRecord
function in a Client Script (CS), the entire process should stop immediately and the record should not be saved. This means that the rest of the deployed CS scripts (not only yours, but all the rest not yet executed) should not run. The page will not reload and any changes made on the record will be discarded. This is the expected behavior and it applies to all CS entry points that return
false
. However, there are some exceptions to this behavior. For example, if the
saveRecord
function is defined as async, it might still submit the record. Also, if you're trying to manually call the
saveRecord
function after returning
false
, you might need to do the equivalent of clicking the submit button again. In the case of a Scheduled Script, returning
false
will not stop the script. To stop a Scheduled Script, you can simply return from the execute function or throw an error. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819977105
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.800921202
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.799873471
Please provide your feedback on this answer.
Thank you for your feedback