set sales order to be tax free (regardless of item...
# ask-stanley-ai
l
set sales order to be tax free (regardless of item tax rate)
c
AI generated answer (using internal Slack threads):
To set a sales order to be tax-free regardless of the item tax rate, you can use a SuiteScript to set the
taxcode
field to a non-taxable tax code for each line item in the sales order. Here is a sample SuiteScript 2.0 code snippet that sets the
taxcode
field to a non-taxable tax code for each line item in a sales order:
Copy code
javascript
var salesOrderRecord = record.load({
    type: record.Type.SALES_ORDER,
    id: 'your_sales_order_id'
});

var lineCount = salesOrderRecord.getLineCount({
    sublistId: 'item'
});

for (var i = 0; i < lineCount; i++) {
    salesOrderRecord.setSublistValue({
        sublistId: 'item',
        fieldId: 'taxcode',
        line: i,
        value: 'your_non_taxable_tax_code'
    });
}

salesOrderRecord.save();
Replace
'your_sales_order_id'
and
'your_non_taxable_tax_code'
with your actual sales order ID and non-taxable tax code respectively. Please note that this script should be executed in a context where it has the necessary permissions to load and edit sales orders. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811497569
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808339238
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.807583
Please provide your feedback on this answer.