AnsweredAssumed Answered

How to merge the two SFDC contacts by saving the latest contact created as masterrecord.

Question asked by KiranReddy7271 on Apr 29, 2014
Latest reply on May 7, 2014 by KiranReddy7271
I'm querying the SFDC contacts and there are two list of documents retrieved (can be more than two results).

Two List documents, one document have one contact and second list document have two contacts.

Now I want to merge the second list document contacts and first document has to be ignored as there are no duplicates.

for SFDC connector merge operatin, the request has to set accordingly.

1. two contact ids can set to recordtomergeids field from the destination profile.
2. for master recordid, I want to compare the two sysmodstamp date and based on the latest date, I could get the contact id from cache and map.

now the issue I'm facing is to get the latest sysmodstamp document (contact) from the multiple list of documents.

could anyone please help me the solurion.
Let me know if required more details.

The sample two documents as below:

1)

<?xml version="1.0" encoding="UTF-8"?>
<ContactList>
  <Contact>
    <Id>0033000000G7mXXAAZ</Id>
    <CreatedDate>2006-02-15T01:24:31.000Z</CreatedDate>
    <SystemModstamp>2014-01-10T00:43:19.000Z</SystemModstamp>
    <Member_ID_or_Suggested_Member_ID__c>6285397</Member_ID_or_Suggested_Member_ID__c>
  </Contact>
</ContactList>
========================================
2)

<?xml version="1.0" encoding="UTF-8"?>
<ContactList>
  <Contact>
    <Id>0036000000Yw9wmAAB</Id>
    <CreatedDate>2007-06-12T18:59:09.000Z</CreatedDate>
    <SystemModstamp>2014-04-10T09:30:07.000Z</SystemModstamp>
    <Member_ID_or_Suggested_Member_ID__c>5511183</Member_ID_or_Suggested_Member_ID__c>
  </Contact>
  <Contact>
    <Id>0036000001DF1qpAAD</Id>
    <CreatedDate>2011-08-26T16:24:36.000Z</CreatedDate>
    <SystemModstamp>2014-04-11T10:34:58.000Z</SystemModstamp>
    <Member_ID_or_Suggested_Member_ID__c>5511183</Member_ID_or_Suggested_Member_ID__c>
  </Contact>
</ContactList>





Thx.

Outcomes