Chris
03/07/2025, 7:38 AMCeligo AI
03/07/2025, 7:38 AMAI generated answer (using internal Slack threads):Based on the conversations, it appears that after saving a record using the
.save()
method in SuiteScript, you cannot directly get the saved record data without loading it again. The .save()
method returns the record's id, but it does not update the .id
property of the record you called .save
on. This means that the record's data does not necessarily reflect what was stored, only what you fed into the system.
If you want to get the saved record data, you would need to load the record again using the record.load()
method. For example:
javascript
var recordId = myRecord.save();
var loadedRecord = record.load({
type: myRecord.type,
id: recordId
});
In this example, loadedRecord
would contain the saved record data. You can then use methods like getValue
and getSublistValue
to retrieve specific fields from the loaded record.
Please note that loading a record again after saving it can add extra latency due to the additional API call. If you only need to update some fields on the saved record, you can use the record.submitFields()
method instead of loading the entire record again.
******
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, 7:38 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813798
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808599174
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806552291
Celigo AI
03/07/2025, 7:38 AM