How do I initialize an invoice with a specific nex...
# suitescript
w
How do I initialize an invoice with a specific nexus?
Copy code
const invoiceRecord = record.create({
        type: record.Type.INVOICE,
        defaultValues: {
            entity: 27214, // the customer which has a default subsidiary in Finland but is available for Germany
            subsidiary: 12, // the subsidiary which is in Germany
        }
    })
I'm getting an error that the German subsidiary doesn't have a tax agency in Finland. In the UI, a change on subsidiary will trigger the change. Do I need to use dynamic mode?
Hmm, it may work with setting the subsidiary after the record is created
b
usually you only need to match the url parameters to default values
w
yeah, I've tried nexus and nexus_country as defaultValues. But it didn't like them
ahh... I think I know what the issue is. I'm trying to apply a billable bill to a billable vendor credit. But the tax code on those is probably automatically set to the tax code for the primary subsidiary on the vendor.
Yup, that was it!
Didn't need to set the nexus, just update the tax code on the lines.