when creating a credit memo with SuiteScript, I ge...
# ask-stanley-ai
m
when creating a credit memo with SuiteScript, I get: Unable to save the transaction due to an error being reported by the tax calculation engine: This Document has used AvaTax Services. TaxOverride.TaxDate is required. any idea?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like you're encountering an issue with AvaTax when trying to create a credit memo using SuiteScript. The error message you're seeing is likely due to the tax calculation engine requiring a
TaxOverride.TaxDate
field when AvaTax services are used. In the provided SuiteScript code, it appears that the
taxdetailsoverride
field is being set, but there's no mention of
TaxOverride.TaxDate
. If AvaTax is being used, you may need to include this field in your script. Here's a general idea of how you might set this field:
Copy code
javascript
if (requestBody.taxOverrideDate) {
    const parsedTaxOverrideDate = format.parse({
        value: requestBody.taxOverrideDate,
        type: format.Type.DATE
    });

    creditMemo.setValue({
        fieldId: 'taxOverrideDate', // replace with actual field ID for TaxOverride.TaxDate
        value: parsedTaxOverrideDate
    });
}
Please replace
'taxOverrideDate'
with the actual field ID for
TaxOverride.TaxDate
in your NetSuite account. ****** 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.86541754
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852050841
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848876953
Please provide your feedback on this answer.