function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CloudCloud 

Check if Contact Exists, If not, then create it.

I'm trying to check and see if the contact exists first before adding an Oppurtunity entry. What's the best way to do this. I'm new to Salesforce by the way but I've been working on the API.
msimondsmsimonds
What are you comparing this against to see if the contact is already in Salesforce?  A database? 

OR

are you wanting to do a live SOQL query against the Opportunity object to see if an contact is already in Salesforce


~Mike
sf_davesf_dave
If you know you _want_ the contact there you should Upsert it so it will update if it already exists, or be created if it doesn't exist

If you just want to check for the existence of something you can just query the contacts assuming you have a unique identifier (Email, Username, or Salesforce ID)

-Dave