Bruce Backman
07/20/2026, 5:13 PMCeligo AI
07/20/2026, 5:14 PMAI generated answer (using internal Slack threads):The most efficient method in SuiteScript 2.x to determine if a particular record exists is to use the
search.lookupFields method. This method is faster and uses less governance than other methods such as record.load. It does not attempt to load the entire record, which makes it quicker.
Here is a sample code snippet:
javascript
var recordExists = function(recordType, recordId) {
try {
var fieldLookUp = search.lookupFields({
type: recordType,
id: recordId,
columns: 'internalid'
});
return (fieldLookUp.internalid) ? true : false;
} catch (e) {
return false;
}
}
In this function, recordType is the type of the record you are looking for and recordId is the internal id of the record. The function will return true if the record exists and false if it does not.
******
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
07/20/2026, 5:14 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.820251524
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.804077148
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.803833
Celigo AI
07/20/2026, 5:14 PMBladeSea
07/20/2026, 6:39 PM