I have the following javascript.
function create_case() { var company={"company": { "name": "CU000001 Anonymous Customer", "internalid": "3" }}; var contact={"contact": { "name": "fake", "internalid": "781" }}; var due_date="7/20/2012"; var record=nlapiCreateRecord('supportcase'); record.setFieldValue('title', 'test'); record.setFieldValue('incomingmessage', 'test incoming message'); record.setFieldValue("company", company); record.setFieldValue('contact', contact); record.setFieldValue('custeventduedate', due_date); id = nlapiSubmitRecord(record, true); return record; } And I'm getting this error. With a similar one for contact. { "error" : { "code" : "INVALID_KEY_OR_REF", "message" : "Invalid company reference key {company={name=CU000001 Anonymous Customer, internalid=3 } } When loading an existing supportcase with the following javascript function create_case() { var record=nlapiLoadRecord('supportcase', '46145'); return record; } I see json output which includes the following. "company": { "name": "CU000001 Anonymous Customer", "internalid": "3" }, "contact": { "name": "fake", "internalid": "781" }, Any ideas as to what's causing the errors?