Implementation Strategy

To retrieve changes from the human resources system, you could call out from Force.com using HTTP or a REST Web service call, as described in Chapter 10. But when you would do this is not clear because Force.com does not receive notifications when the human resource system is updated. Polling the system for changes would be inefficient and quickly hit governor limits on Web service callouts.

Instead, use the Enterprise API to connect to Force.com and upsert the modified records. Begin by updating a single field called Active__c, indicating whether the employee is active. After you get this field working, move on to support additional fields such as the address and phone fields of the Contact record.

The first problem is finding a common key to employees in both systems. Assume that the human resources system cannot be changed and focus on adapting Force.com to maintain the mapping between the two systems. Create a new field named Resource ID (API name of Resource_ID__c) on the Contact object to store employee identifiers used by the human resources system. For this example, make it a Number type, six digits in length, required, unique, and an external ID.


Caution

Remember that you need to regenerate the client code from Enterprise WSDL after you add this new field; otherwise, it will not be available to your program.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.63.208