Wits end again. Probably me, but becoming blurry-eyed reading docs over and over to find nothing...
I am trying to create a customer record (nlapiCreateRecord('customer')). Works fine, saves fine, etc but can not figure out any way to get the address fields set. Can anyone help? Is it a separate record that is linked? Help. Tried defaultaddress but it didn't work either.
Second question around contact. After I create the customer record, I get the Id back and try to create a contact record associated with the just created customer record. I pass the Id for the 'company' field, and set the other fields I need to. When I submit the record (nlapiSubmitRecord) I get a _funcname not defined. It is in a different try/catch than the field setting and object creating so can't figure it out (see code below). If anyone can spot it please let me know.
try { var conRec = nlapiCreateRecord('contact'); } catch(e) { alert("Error occurred trying to create the contact record for '"+contactFullName+"'nError:n"+e.message); return false; } if ( !conRec ) { alert("Error occurred trying to create the contact record for '"+contactFullName+"'"); return false; } try { // set fields conRec.setFieldValue('company',id); conRec.setFieldValue('firstname',contactFName); conRec.setFieldValue('lastname', contactLName); conRec.setFieldValue('email', contactEmail); conRec.setFieldValue('phone', contactPhone); conRec.setFieldValue('fax', contactFax); } catch(e) { alert("Error occurred trying to set fields in the contact record for '"+contactFullName+"'nError:n"+e.message); return false; } try { // save the contact record nlapiSubmitRecord(conRec); } catch(e) { <span style="color:'"DarkRed"'">// THIS IS WHERE i'M CATCHING THE ERROR!</span> alert("Error occurred trying to save the contact record for '"+contactFullName+"'nError:n"+e.message); return false; }Thanks.-Steve