I am having a :h_a_w: problem with creating a Support Case in Netsuite.
We have a Contact Us page on our site that asks for customer order information and this submits the information to a Suitelet. The suitelet also submits lead information into the Netsuite backend. The leads are submitted successfully into Netsuite, however I've been unable to create cases. I've hardcoded valid values into the submit statements but to no avail. The odd thing is that when I submit this information on the Client Side, and in the debugger, it creates the case and returns the id.
I went so far as to create a custom record to hold the values and then submit these as support cases using an afterSubmit User Event script and this once again returned the same error.
The only error message I receive is "UNEXPECTED ERROR", no code or any other details, so I have no idea what could be the hang up. I know I have all the required fields filled out as the case submits on the Client.
Any ideas?
var caseRecord = nlapiCreateRecord('supportcase'); caseRecord.setFieldValue('company',5555555); //Valid customer ID caseRecord.setFieldValue('incomingmessage','Test Case'); caseRecord.setFieldValue('email',"test@email.com"); caseRecord.setFieldValue('phone','(123) 456-7890'); caseRecord.setFieldValue('custevent_sales_order_no',5555555); //Valid Sales Order # caseRecord.setFieldValue('title','Web Inquiry'); caseRecord.setFieldValue('origin',9); //9 = Web Inquiry nlapiLogExecution("DEBUG","Case Record",JSON.stringify(caseRecord)); //Log what the caseRecord object looks like before submission try { nlapiSubmitRecord(caseRecord,false,true); //Ignoring mandatory fields to ensure that isnt' the issue } catch (e) { nlapiLogExecution("DEBUG","Error",e); //This returns "UNEXPECTED ERROR" }