How do you not save the record with an AfterSubmit...
# suitescript
a
How do you not save the record with an AfterSubmit script? I thought 'return false;' would work but it is still saving the record
j
@Alex K you cannot stop a save in an AfterSubmit, it's after it has been submitted so it's already been created. You can throw an error in a beforeSubmit to stop a save but it will produce an ugly error. If possible it's best to do this in the saveRecord function in a client script.
a
sorry, my mistake meant BeforeSubmit type, you still answered my question anyway, thanks!
s
If the record is being submitted in the UI, return false on a client is a safe way as well.
j
No problem!