• mdrussell0779
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

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?