how to get nexus country code in script
# ask-stanley-ai
t
how to get nexus country code in script
c
AI generated answer (using internal Slack threads):
To get the nexus country code in a script, you can use the
getValue
method on the
nexus
field of the
TaxGroup
record. Here is a sample code snippet:
Copy code
javascript
var taxgroupRecord = record.load({
    type: record.Type.TAX_GROUP,
    id: taxGroupId
});
var nexusId = taxgroupRecord.getValue({
    fieldId: 'nexus'
});
Once you have the
nexusId
, you can load the
Nexus
record and get the country code:
Copy code
javascript
var nexusRecord = record.load({
    type: record.Type.NEXUS,
    id: nexusId
});
var countryCode = nexusRecord.getValue({
    fieldId: 'country'
});
Please note that this is a workaround and may not work in all cases. The issue of tax nexuses defaulting to US even when shipping address countries are set properly is a known issue and has been marked as a defect by NetSuite. ****** 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.772033691
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.768127441
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.763275146
Please provide your feedback on this answer.