reptar
03/11/2021, 6:56 PMvar contact = record.create({type: record.Type.CONTACT});
if (customerID) {contact.setValue({fieldId: 'company', value: customerID});}
if (customerInfo[1].contacts[1].lastName) {contact.setValue({fieldId: 'lastname', value: customerInfo[1].contacts[1].lastName});}
if (customerInfo[1].contacts[1].firstName) {contact.setValue({fieldId: 'firstname', value: customerInfo[1].contacts[1].firstName});}
if (customerInfo[1].contacts[1].middleName) {contact.setValue({fieldId: 'middlename', value: customerInfo[1].contacts[1].middleName});}
if (customerInfo[1].contacts[1].salutation) {contact.setValue({fieldId: 'salutation', value: customerInfo[1].contacts[1].salutation});}
if (customerInfo[1].contacts[1].jobTitle) {contact.setValue({fieldId: 'title', value: customerInfo[1].contacts[1].jobTitle});}
if (customerInfo[1].contacts[1].phone) {contact.setValue({fieldId: 'phone', value: customerInfo[1].contacts[1].phone});}
if (customerInfo[1].contacts[1].email) {contact.setValue({fieldId: 'email', value: customerInfo[1].contacts[1].email});}
if (customerInfo[1].contacts[1].addressOne) {contact.setSublistValue({sublistId: 'addressbook', fieldId: 'addr1', line: 0, value: customerInfo[1].contacts[1].addressOne});}
//if (customerInfo[1].contacts[1].addressOne) {contact.setSublistValue({sublistId: 'addressbook', fieldId: 'addr2', line: 0, value: null});}
if (customerInfo[1].contacts[1].city) {contact.setSublistValue({sublistId: 'addressbook', fieldId: 'city', line: 0, value: customerInfo[1].contacts[1].city});}
if (customerInfo[1].contacts[1].state) {contact.setSublistValue({sublistId: 'addressbook', fieldId: 'state', line: 0, value: customerInfo[1].contacts[1].state});}
if (customerInfo[1].contacts[1].zip) {contact.setSublistValue({sublistId: 'addressbook', fieldId: 'zip', line: 0, value: customerInfo[1].contacts[1].zip});}
if (customerInfo[1].contacts[1].country) {contact.setSublistValue({sublistId: 'addressbook', fieldId: 'country', line: 0, value: customerInfo[1].contacts[1].country});}
if (customerInfo[1].contacts[1].leadSource) {contact.setValue({fieldId: 'leadsource', value: customerInfo[1].contacts[1].leadSource});}
contact.save();
I'm getting USER_ERROR, Please enter value(s) for: Address.reptar
03/11/2021, 7:07 PMbattk
03/11/2021, 7:09 PMbattk
03/11/2021, 7:09 PMbattk
03/11/2021, 7:09 PMreptar
03/11/2021, 7:09 PMstalbert
03/11/2021, 11:12 PM