James Morris
02/17/2026, 9:45 PMCeligo AI
02/17/2026, 9:45 PMAI generated answer (using internal Slack threads):Based on the conversations, here is a sample SuiteScript 2.1 map/reduce script that can be used to search for transactions with a lastmodifieddate of today and for each transaction, get the customer internal id and set the custentity_paymentstatus field on the customer record to 1.
javascript
/**
* @NApiVersion 2.1
* @NScriptType MapReduceScript
*/
define(['N/search', 'N/record'], function(search, record) {
function getInputData() {
return search.create({
type: 'transaction',
filters: [
['lastmodifieddate', 'on', 'today']
],
columns: ['internalid', 'entity']
});
}
function map(context) {
var searchResult = JSON.parse(context.value);
var customerId = searchResult.values['entity'][0].value;
context.write(customerId, null);
}
function reduce(context) {
var customerId = context.key;
record.submitFields({
type: record.Type.CUSTOMER,
id: customerId,
values: {
custentity_paymentstatus: 1
}
});
}
return {
getInputData: getInputData,
map: map,
reduce: reduce
};
});
This script creates a search in the getInputData stage to find all transactions with a lastmodifieddate of today. The map stage then processes each search result, extracting the internal id of the customer associated with each transaction. The reduce stage then updates the custentity_paymentstatus field on each customer record to 1.
******
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
02/17/2026, 9:45 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83227545
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83203131
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82824713
Celigo AI
02/17/2026, 9:45 PM