/
Finding a Contact by Email Address
Finding a Contact by Email Address
This code block returns a Salesforce Contact record to Sitecore based on the email address.
SalesforceSession salesforceSession = new SalesforceSession(new LoginDetails("username@example.com", "salesforcePassword")); ContactDataSource contactDataSource = new ContactDataSource(salesforceSession); string emailToFind = "@edge.com"; contactDataSource.AddDataSourceFilter("email", ComparisonOperator.Contains, emailToFind); contactDataSource.AddDataSourceFilter("IsDeleted", ComparisonOperator.NotEquals, true); var queryResult = contactDataSource.RunQuery(); List<Contact> contacts = contactDataSource.EntitysFromQueryResult<Contact>(queryResult);
Related content
S4S Code Examples
S4S Code Examples
Read with this
Create a New Account
Create a New Account
Read with this
Saving to Salesforce from an MVC form
Saving to Salesforce from an MVC form
Read with this
Searching Salesforce Records
Searching Salesforce Records
Read with this
S4S Resources
S4S Resources
Read with this