Hi,
I'm trying to update a contact, contactEmailAddress, contactPhoneNumber by xml-http api,
but I receive a Transaction Error.
If I comment the code to update contactEmailAddress and contactPhoneNumber,
the operation works fine.
Someone help me please.
:)
DataRecord tab = new DataRecord();
tab.setName("contact");
tab.setAction(DataRecord.UPDATE);
tab.setShareKey(true);
tab.addField("id", bean.getId());
tab.addField("nameFirst", bean.getNameFirst());
tab.addField("nameLast", bean.getNameLast());
tab.addField("company", bean.getCompany());
tab.addField("title", bean.getTitle());
tab.addField("source", bean.getSourceName());
tab.addField("isLead", "true");
tab.addField("accessType", 2);
tab.addField("leadStatus", 1);
tab.addField("enteredBy", 0);
tab.addField("modifiedBy", 0);
crm.save(tab);
// email
DataRecord email = new DataRecord();
email.setName("contactEmailAddress");
email.setAction(DataRecord.UPDATE);
EmailAddressList eal = bean.getEmailAddressList();
if (eal != null && eal.size() > 0)
email.addField("email", bean.getEmailAddress(0));
}
email.addField("type", 1);
email.addField("enteredBy", 0);
email.addField("modifiedBy", 0);
crm.save(email);
// phone
DataRecord phone = new DataRecord();
phone.setName("contactPhoneNumber");
phone.setAction(DataRecord.UPDATE);
PhoneNumberList pnl = bean.getPhoneNumberList();
if (pnl != null && pnl.size() > 0)
phone.addField("number", bean.getPhoneNumber(0));
}
phone.addField("type", 1);
phone.addField("enteredBy", 0);
phone.addField("modifiedBy", 0);
crm.save(phone);
Tanks in Advance
Alessandro