When using the removeLine on an aftersubmit user e...
# ask-stanley-ai
s
When using the removeLine on an aftersubmit user event script, no lines are being removed, but the script is also not erroring out. What could be wrong?
c
AI generated answer (using internal Slack threads):
The issue you're experiencing with the
removeLine
function in an afterSubmit user event script might be due to the fact that the
newRecord
in a user event script is not in dynamic mode. The
selectLine
and
removeLine
functions are methods that are used with records that are in dynamic mode. In an afterSubmit user event script, trying to modify the
newRecord
doesn't work because the record has already been saved. If you're trying to remove a line from a record, you might want to consider doing this in a beforeSubmit user event script or a client script instead. Here's a general rule of thumb: - If you're trying to modify a record based on user interaction, a client script would be more suitable. - If you're trying to modify a record based on changes to the record itself, a beforeSubmit user event script would be more suitable. Remember, loading a record in dynamic mode in an afterSubmit script can have a significant impact on performance. It's generally not recommended to load and save the current record in beforeLoad and beforeSubmit entry points due to performance considerations. ****** 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.837572217
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836649418
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835865438
Please provide your feedback on this answer.
Thank you for your feedback