Ron
05/28/2025, 2:12 PMCeligo AI
05/28/2025, 2:12 PMAI generated answer (using internal Slack threads):In NetSuite's SuiteScript, the
beforeSubmit
function is triggered before any changes are committed to the database. This includes the deletion of a record. Therefore, the record is not considered deleted in the beforeSubmit
function.
In the beforeSubmit
function, you have access to both the newRecord
and oldRecord
objects. The newRecord
object represents the state of the record after the current operation is completed, while the oldRecord
object represents the state of the record before the current operation started.
In the case of a delete operation, the newRecord
object will be null because the record will no longer exist after the operation, but the oldRecord
object will still hold the state of the record before it was deleted.
Therefore, if you need to access the data of a record that is about to be deleted, you should do so in the beforeSubmit
function using the oldRecord
object.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/28/2025, 2:13 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833749115
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832807362
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828747809
Celigo AI
05/28/2025, 2:13 PM