CRMfusion Forums

Working With the API  


0

Hi,  

The organization I am supporting loads thousands of records via the API several times a year.   When new Individual Accounts are created we also create objects that relate to these accounts.  The problem is that the ID for the individual account is changing.  

I thought that I could keep the newest record (the one I just created via the API).  This is the most simple solution.  I create a record via the API and if it merges then the data merges into this record ID that my implementation is aware.  

If this is not possible is there an SOQL query to see what the new ID for a record is based on the ID that was just deleted.  If there is not then I think what I will need to do is import all the data, then go back and for each record, I imported see if the ID I have is attached a record that is_deleted and then if it is, find the ID for an account that has the same first, name, last name, and email.  This is not ideal but possible.  

Thanks,

Steve 

 
0

My solution does not use DupeBlocker.  I am just sending an API call back to SalesForce and looking to see if the record still exists in SalesForce.   $sfid is the Salesforce Id of the original object created.  

$query = "SELECT IsDeleted FROM Account  WHERE Id ='" . $sfid . "'";

I get this back from Salesforce.

(
    [totalSize] => 0
    [done] => 1
    [records] => Array
        (
        )

)

To know it is deleted I do check that totalSize is 0 and done equals 1. The problem with this approach is that I do not have an absolute confirmation that the record is deleted. The Drupal implementation of the SalesForce API was having trouble checking the recycling bin. I hope this helps someone. If someone has a better way to do this I am very open to it.

 
  
Working

Please Login or Register