ConcourseSuite Support

Support
Corporate
PUBLIC PROFILE

Back to topics

Discuss Development

Problem update contact, contactEmailAddress, contactPhoneNumber object by XML-HTTP API

You need to be logged in to post messages

This question is unanswered

Problem update contact, contactEmailAddress, contactPhoneNumber object by XML-HTTP API

5/22/2008 9:34 AM EDT

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

1. 5/23/2008 3:38 AM EDT (edited)

Any type of Help is Welcome.

1. There are some rules to identify in "update" request the
fields that are mandatory, if yes where could I view them?

2. Where is the rules to update an Object that contains some
others objects:
I have read this code to insert a Contact and relatives Object,
but I don't view an example to update the same objects in this example:

DataRecord contact = new DataRecord();
contact.setName("contact");
contact.setAction(DataRecord.INSERT);
contact.setShareKey(true);
contact.addField("nameFirst", bean.getNameFirst());
contact.addField("nameLast", bean.getNameLast());
contact.addField("company", bean.getCompanyName());
contact.addField("title", bean.getTitle());
contact.addField("source", bean.getSourceId());
contact.addField("isLead", "true");
contact.addField("accessType", 2);
contact.addField("leadStatus", 1);
contact.addField("enteredBy", 0);
contact.addField("modifiedBy", 0);
crm.save(contact);

//email
DataRecord email = new DataRecord();
email.setName("contactEmailAddress");
email.setAction(DataRecord.INSERT);
email.addField("email", bean.getEmail());
email.addField("contactId", "$C");
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.INSERT);
phone.addField("number", bean.getPhone());
phone.addField("contactId", "$C");
phone.addField("type", 1);
phone.addField("enteredBy", 0);
phone.addField("modifiedBy", 0);
crm.save(phone);

3. In case of error for example 'Transaction Error'
Is there a way to view a meaning error on the server log?
If yes where could I view its?

Thanks in Advance.
Alessandro

1 result found