Nour Khaled
05/17/2025, 6:31 PMCeligo AI
05/17/2025, 6:32 PMAI generated answer (using internal Slack threads):In order to get a list of all changed fields with respective ids and new values on saveRecord client script event, you can use the
fieldChanged
event in SuiteScript 2.0. This event is triggered whenever a field is changed in the UI.
Here is a sample code snippet that demonstrates how to use the fieldChanged
event:
javascript
function fieldChanged(context) {
var currentRecord = context.currentRecord;
var fieldName = context.fieldId;
var newValue = currentRecord.getValue(fieldName);
console.log('Field: ' + fieldName + ', New Value: ' + newValue);
}
In this code, context.fieldId
gives you the id of the field that was changed, and currentRecord.getValue(fieldName)
gives you the new value of the field.
However, please note that this will only track changes made in the UI and won't track changes made through CSV imports or other bulk operations. Also, this won't track changes made to sublist fields. For sublist fields, you would need to use the sublistChanged
event.
******
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/17/2025, 6:32 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852280617
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848263562
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8436113
Celigo AI
05/17/2025, 6:32 PM