To update the Account record we need to first add web reference to the account.wsdl.
Than can make use of AccountUpdate method of Account Entity.
// Login to the CRM server
string loginUrlString = “https://servername/Services/Integration?command=login”;
// Get the valid Session id to be appended for each subsequent request
String sessionID = ManageSession.Login(loginUrlString, @”orgname/username”, “password”);
try
{
// Download the account wsdl from the Admin section of the CRM application
// Add web reference to the wsdl
// Create the instance of the opportunity entity
Account myAcc = new Account();
myAcc.Url = “https://secure-ausomxapa.crmondemand.com/Services/Integration;jsessionid=” + sessionID;
// Create the instance of Account Data
AccountData[] myAccData = new AccountData[1];
myAccData[0] = new AccountData();
// the order number to be updated
myAccData[0].stOrder_Number = “orderNumber”;
// the id of the account to be updated
myAccData[0].Id = “orderID”;
// creating ListOfAccountData object
ListOfAccountData myLstOfAcctData = new ListOfAccountData();
myLstOfAcctData.Account = myAccData;
// using AccountUpdate_Input
AccountUpdate_Input myAccUpdateInput = new AccountUpdate_Input();
myAccUpdateInput.ListOfAccount = myLstOfAcctData;
// using account’s Accout Update method to update the record
AccountUpdate_Output myAccntUpdateOutput = myAcc.AccountUpdate(myAccUpdateInput);
}
catch (SoapException ex)
{
}
catch (Exception ex)
{
}
That’s it …