Sarah
03/07/2025, 5:13 PMCeligo AI
03/07/2025, 5:13 PMAI generated answer (using internal Slack threads):To pull the date when the status field changes from an old value to a new value in a saved search, you would typically need to use a system notes field. However, NetSuite does not directly support this functionality in saved searches. The system notes field in NetSuite keeps track of all changes made to a record, including the old value, new value, and the date/time of the change. But, unfortunately, you can't directly reference these fields in a saved search formula. A workaround could be to create a custom field that gets updated via a SuiteScript each time the status field changes. This custom field would store the date of the change. Then, you can reference this custom field in your saved search. Here is a pseudo-code example of how the SuiteScript might look:
javascript
function beforeSubmit(scriptContext) {
if (scriptContext.type !== scriptContext.UserEventType.CREATE) {
var oldRecord = scriptContext.oldRecord;
var newRecord = scriptContext.newRecord;
var oldStatus = oldRecord.getValue({fieldId: 'status'});
var newStatus = newRecord.getValue({fieldId: 'status'});
if (oldStatus !== newStatus) {
newRecord.setValue({
fieldId: 'custentity_status_change_date',
value: new Date()
});
}
}
}
Remember to replace 'status' and 'custentity_status_change_date' with your actual field IDs.
******
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
03/07/2025, 5:14 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823145092
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821566
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816558361
Celigo AI
03/07/2025, 5:14 PM