Created
August 11, 2010 12:30
-
-
Save steefjan/518903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Eventhandler for GetDetails button click | |
/// </summary> | |
/// <param name="sender"></param> | |
/// <param name="e"></param> | |
private void btnGetDetails_Click(object sender, EventArgs e) | |
{ | |
//Initialize textbox | |
txtAccountDetails.Text = ""; | |
//Create instance proxy to service | |
CRMContactService svc = new CRMContactService(); | |
//Instantiate SessionHeader Object | |
SalesForce.Integration.POC.TestApp.SFSvcAccountRef.SessionHeader sessionHeader = new SalesForce.Integration.POC.TestApp.SFSvcAccountRef.SessionHeader(); | |
//Create an instance of SalesForce Account object | |
SalesForce.Integration.POC.TestApp.SFSvcAccountRef.Account account = new SalesForce.Integration.POC.TestApp.SFSvcAccountRef.Account(); | |
try | |
{ | |
//Retrieve Session ID | |
sessionHeader.sessionId = ForceToken.SessionId; | |
//Assign SessionId to Header | |
svc.SessionHeaderValue = sessionHeader; | |
//Call Service | |
account = svc.GetAccountByName(txtAccountName.Text); | |
//Report results back to textbox | |
txtAccountDetails.Text = account.Website; | |
} | |
catch (Exception ex) | |
{ | |
MessageBox.Show(ex.Message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment