Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This code block populates a new Account in Salesforce from Sitecore.

Code Block
languagec#
Account account = new Account();
account.Name = "FuseIT";
 
SalesforceSession salesforceSession = new SalesforceSession(new LoginDetails("username@example.com", "salesforcePassword"));
AccountService accountService = new AccountService(salesforceSession);
 
var saveResult = accountService.Insert(account);
string newAccountId = null;
if (saveResult.success)
{
    newAccountId = account.Id;
}
Assert.IsTrue(accountService.ValidEntityId(newAccountId));