darrenhillconsulting
08/29/2024, 1:14 PMCeligo AI
08/29/2024, 1:14 PMAI generated answer (using internal Slack threads):To set the
hasTotals
on the search.create
in SuiteScript 2.1, you can use the search.create
method and set the hasTotals
property to true
. However, it's important to note that the hasTotals
property is not available in all search types.
Here is an example of how you can do it:
javascript
var mySearch = search.create({
type: search.Type.SALES_ORDER,
filters: [
["type", "anyof", "SalesOrd"],
"AND",
["internalid", "anyof", netsuiteId],
],
columns: [
search.createColumn({ name: "tranid", label: "Document Number" }),
search.createColumn({
name: "taxtotal",
label: "Amount (Transaction Tax Total)",
}),
search.createColumn({
name: "total",
label: "Amount (Transaction Total)",
}),
search.createColumn({
name: "shippingamount",
label: "Amount (Shipping)",
}),
search.createColumn({
name: "formulatext",
formula: "NVL({discountamount}, 0)",
label: "Amount Discount",
}),
],
hasTotals: true,
});
******
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/29/2024, 1:15 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.813728154
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811015368
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.803140879
Celigo AI
08/29/2024, 1:15 PM