Fernando Batres
06/12/2025, 8:41 PMCeligo AI
06/12/2025, 8:42 PMAI generated answer (using internal Slack threads):To add the subaccounts names or id's to your saved search, you can add a new column to your search. You can use the
search.createColumn
method to create a new column for the subaccount name or id. Here is an example of how you can do it:
javascript
const salesOrderSearchColSubaccount = search.createColumn({ name: 'subsidiary' });
Then, add this new column to your search:
javascript
const salesOrderSearch = search.create({
type: 'salesorder',
filters: salesOrderSearchFilters,
columns: [
salesOrderSearchColDateCreated,
salesOrderSearchColItem,
salesOrderSearchColDisplayName,
salesOrderSearchColAmount,
salesOrderSearchColSubaccount
],
});
In the result processing, you can get the subaccount name or id like this:
javascript
const subaccount = result.getValue(salesOrderSearchColSubaccount);
And add it to your result object:
javascript
return {
dateCreated: dateCreated ? String(dateCreated) : '',
item: item ? String(item) : '',
displayName: displayName ? String(displayName) : '',
amount: amount ? Number(amount) : 0,
subaccount: subaccount ? String(subaccount) : ''
};
This way, each result will have the subaccount name or id, so you can know which subaccount has bought each item.
******
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
06/12/2025, 8:42 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.86289835
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849019408
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.835325956
Celigo AI
06/12/2025, 8:42 PM