Ron
01/03/2025, 4:47 PMCeligo AI
01/03/2025, 4:47 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** Performing a search or using SuiteQL can significantly reduce the time and governance units consumed by your script. Here's an example: When you need to retrieve a large amount of data, using SuiteQL can be more efficient than using the search module. SuiteQL allows you to define queries that might be impossible with a single saved search, and its performance is generally better. For instance, a recent test showed that SuiteQL could retrieve 100,000 rows in just 0.53 seconds, while using the search module for every X,000 rows could take tens of seconds to minutes, depending on the search parameters and dataset being called. Here's a sample SuiteQL code:
javascript
var suiteQL = "SELECT * FROM transaction WHERE subsidiary = 1";
var suiteQLResultSet = query.runSuiteQL(suiteQL);
var suiteQLResult = suiteQLResultSet.asMappedResults();query.runSuiteQL(suiteQL)asMappedResults()lookupFieldsjavascript
var recordType = 'salesorder';
var recordId = '12345';
var fields = ['entity', 'total'];
var result = record.lookupFields({
    type: recordType,
    id: recordId,
    columns: fields
});lookupFieldslookupFieldsCeligo AI
01/03/2025, 4:48 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826217473
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.825600088
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.822869241
Celigo AI
01/03/2025, 4:48 PM