Centric CRM Tools Package
Centric CRM Tools includes multi-platform code to communicate with the Centric CRM application using HTTP. For example, you can capture leads or tickets from your existing web site and send them straight into Centric CRM by using the "save" method.
You can also read data from Centric CRM by using the "load" method. The following actions are supported:
- DataRecord.INSERT
- DataRecord.SELECT
- DataRecord.UPDATE
- DataRecord.DELETE
- DataRecord.GET_DATETIME
Requirements
The centric_crm_tools.jar can be used with any Java 1.4 or 1.5 application. You will need to have the Java Servlet-API in your classpath.
In Centric CRM 4.0, a "client" will need to be configured under the Admin module to provide remote access to Centric CRM.
In versions prior to 4.0, the Centric CRM database needs to be modified manually:
- In the [sync_client] table, an arbitrary client should be inserted with a plain-text password in the [code] field. This will be used in the client authentication code.
Typical Usage
import org.aspcfs.utils.CRMConnection; import org.aspcfs.apps.transfer.DataRecord; // Client ID must already exist in target CRM system and is created // under Admin -> Configure System -> HTTP-XML API Client Manager int clientId = 1; // Establish connectivity information CRMConnection crm = new CRMConnection(); crm.setUrl("http://www.yourorg.com/centric"); crm.setId("www.yourorg.com"); crm.setCode("password"); crm.setClientId(clientId); // Start a new transaction crm.setAutoCommit(false); 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); // Transform the email DataRecord email = new DataRecord(); email.setName("contactEmailAddress"); email.setAction(DataRecord.INSERT); email.addField("email", bean.getEmail()); email.addField("contactId", "$C{contact.id}"); email.addField("type", 1); email.addField("enteredBy", 0); email.addField("modifiedBy", 0); crm.save(email); // Transform the phone DataRecord phone = new DataRecord(); phone.setName("contactPhoneNumber"); phone.setAction(DataRecord.INSERT); phone.addField("number", bean.getPhone()); phone.addField("contactId", "$C{contact.id}"); phone.addField("type", 1); phone.addField("enteredBy", 0); phone.addField("modifiedBy", 0); crm.save(phone); boolean result = crm.commit(); System.out.println(crm.getLastResponse());
Sign in to add your comment.