James Morris
08/06/2025, 5:23 PMCeligo AI
08/06/2025, 5:23 PMAI generated answer (using internal Slack threads):To create an ad-hoc search in SuiteScript 2.x for transactions with account type of account receivable and last modified date of today, and include columns of the linked customer internal id, you can use the
search
module of SuiteScript 2.x. Here is a sample code snippet:
javascript
var search = require('N/search');
var transactionSearch = search.create({
type: search.Type.TRANSACTION,
filters: [
['type', 'anyof', 'CustInvc'], // Customer Invoice
'AND',
['accounttype', 'anyof', 'AcctRec'], // Account Receivable
'AND',
['lastmodifieddate', 'on', 'today']
],
columns: [
search.createColumn({
name: 'internalid',
join: 'customer'
})
]
});
var searchResult = transactionSearch.run().getRange({
start: 0,
end: 100
});
for (var i = 0; i < searchResult.length; i++) {
var customerInternalId = searchResult[i].getValue({
name: 'internalid',
join: 'customer'
});
log.debug('Customer Internal ID', customerInternalId);
}
This script creates a search on transactions of type 'Customer Invoice' with account type 'Account Receivable' and last modified date of today. It includes the internal id of the linked customer in the search results. The search results are then looped through to log the internal id of each linked customer.
******
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
08/06/2025, 5:23 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82768929
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819870234
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818916798
Celigo AI
08/06/2025, 5:23 PM