I am trying to get a script to set a field in a Purchase Order after processing a Sales Order. The field is 'department' and the reference key is 71. However, I am getting the error: "Invalid department reference key 71 for subsidiary "
The code is simple enough:
obj_New_PO.setFieldValue('department', 71);
I am fairly new to NetSuite scripting so I am not sure on this error. I checked the reference keys for 'department' (under Setup -> Company -> Departments) and 71 does exist.
Any ideas as to why the Purchase Order is not seeing the correct reference key?
Thank you.