+ Start a Discussion

upsert/update null fields only

I'm building an app that needs to take a large number of contacts and synch them with salesforce contacts based on email addresses (which i've set up as a custom field for an external facing id).  I can use upsert to update/insert in bulk which works great, but also need to have the ability to do the same thing but not overwrite existing data in some cases.  I wouldn't want to have to retrieve each contact from SF and compare to the contact for import.  I could build some kind of massive request based on groups of email addresses and then compare larger groups which would at least reduce the number of calls I have to make back and forth, but I'm hoping to find a better solution.  Any ideas?
Tran ManTran Man
How many records are you working with?  I have a query that pulls back 15000 records in about 10-20 seconds.  After the retrieval, just do the comparison in memory.
I'm glad to hear 15000 is only taking about 10-20 seconds.  I guess I don't really mind if the whole thing took even a few minutes--I would just like to reduce the number of calls I need to make, reduce data requests I don't entirely need, and minimize the amount of memory required for each process.  The app is for different users some of whom will have 300 contacts to synch and others with 300,000.