You need to sign in to do that
Don't have an account?
Getting ID of contact by email?
Guys,
I'm farily new to the API. I am successfully inserting data into our tables, but one of the tables requires a contact, so I'm wondering how I get the ID of the contact by a provided email address?
Example:
SforceService.Storage_Work_Order__c soh = new SforceService.Storage_Work_Order__c();
soh.Order_Date__c = new DateTime(2011, 9, 12);
soh.Order_Date__c = DateTime.Today;
// Get ID of requesting customer by provided email address.
soh.Requesting_Customer__r.Id = ????
^^^^^
I assume I'd need to build a contact object based on the result of the email address search and pass that object to the customer_r.id field. Does anyone have an example?
Assuming your contact records have unique email addresses, you might try something like the following: