Mike Casey
11/26/2024, 7:15 PMCeligo AI
11/26/2024, 7:15 PMAI generated answer (using internal Slack threads):To see the event of a return authorization changing status from "Pending Receipt" to "Pending Refund" in a user event SuiteScript, you would need to use the
beforeSubmit
or afterSubmit
events in your user event script.
In these events, you can check the old and new status of the record. If the old status was "Pending Receipt" and the new status is "Pending Refund", then you know that the status has changed in the way you're interested in.
Here is a sample code snippet:
javascript
function afterSubmit(context) {
if (context.type !== context.UserEventType.CREATE && context.type !== context.UserEventType.EDIT) {
return;
}
var newRecord = context.newRecord;
var oldRecord = context.oldRecord;
var newStatus = newRecord.getValue('status');
var oldStatus = oldRecord.getValue('status');
if (oldStatus === 'Pending Receipt' && newStatus === 'Pending Refund') {
// The status has changed from 'Pending Receipt' to 'Pending Refund'
// Add your code here
}
}
Please note that the field id for status might be different in your account, so you might need to adjust the field id in the getValue
function.
******
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
11/26/2024, 7:16 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814672112
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.814056695
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.809717417
Celigo AI
11/26/2024, 7:16 PMIsaac Rumbold
11/26/2024, 7:21 PM