I have written a script that automatically and dynamically creates a sales order when a case is created with certain conditions. In the afterSubmit() method of my user event script, I attempt to attach the support case to the sales order using the Record.attach() method.
I get the following error:
Attaching of record type supportcase to salesorder is not supported.
record.attach({
record: context.newRecord,
to: { type: record.Type.SALES_ORDER, id: salesId }
});
Any ideas why NetSuite might be giving this error? It lets me attach them just fine in the UI. Is there any way to automate this step either via scripting or workflow?