We want to sync our web application with Centric CRM. So we want to lookup accounts/contacts within Centric
and issue an update for existing accounts/contacts, or an insert for new ones.
Q1) How do we do the lookup to see if the account exists?
Q2) How do we get the account and/or contact primary keys for any record that was found?
Q3) What are the different XML response ids, and what do the values mean?
Can someone post an example of a lookup and then an update or insert depending on whether a record was found.
Thanks
Below is code that "talks" successfully to Centric but doesn't give us the data we want or expect.
// Establish connectivity information
CRMConnection crm = new CRMConnection();
crm.setUrl("http://www.mydomain.com");
crm.setId("www.mydomain.com");
crm.setCode("xxxxxxxxxxx");
crm.setClientId(1);
crm.setSystemId(4);
// Start a new transaction
crm.setAutoCommit(false);
DataRecord contact = new DataRecord();
contact.setName("account");
contact.setAction(DataRecord.SELECT);
contact.addField("accountNumber", "X12344");
boolean okLoad = crm.load(contact);
System.out.println("load OK? " + okLoad);
boolean result = crm.commit();
System.out.println(crm.getLastResponse());
This is the data I get back (on the console)
load OK? true
<?xml version="1.0" encoding="UTF-8"?>
<aspcfs><response id="2"><status>0</status><errorText/></response></aspcfs>