Can't update NetSuite record with multiple sublists

I have a flow that either adds or updates an existing record. On the update, when I only use the tax registration sublist, it works with the fields shown in the screenshot below. As soon as I add another sublist, I get the error:
**You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist
**

You can see in the log the r.removeLine and r.insertLine for the sublistId “taxregistration” but it is only doing r.insertLine for the subilst “contact”. No r.removeLine.

Any ideas how to get multiple sublist updates working? I also tried “use as a key field to find existing lines” and all kinds of other variations.

Thanks in advance.

Hi Daniel,

If I’m not mistaken you can’t directly add to the contact sublist on the customer. This is a NetSuite/Suitescript limitation.

You would first create the customer, in a second import create the contact, then in the third import attach the contact to the customer.

Why the third import? Couldn't you just return the customer id from NetSuite in the response mapping, and map that to the customer field on the contact in the second import?

This should work. I’ve implemented it this way before, and the contact will be reflected under the customer.

This is where I update the customer id on a contact record:

@Daniel_P Everybody is correct here.

If you want to set the Primary Customer for the Contact then Ezriah’s and Nuri’s comments will work and you don’t need to attach the Contact because it will happen automatically.

But if you want to have a single Contact that is linked to multiple Customers, then you will need to attach the Contact to the other non-Primary Customers as per Bas’ comment.