Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

This code block populates a new Account in the M4S Cache. If there is an active connection to Salesforce, then it will also be populated in Salesforce, otherwise Leads should be configured for synchronization.

Lead lead = new Lead();

lead.FirstName = "Sally";
lead.LastName = "James";
lead.Email = "sally@test.com";
lead.Company = "FuseIT Ltd";

GenericMongoService service = new GenericMongoService(Lead.SFType);

var saveResult = service.Insert(lead);
string newLeadId = null;

if (saveResult.success)
{
    newLeadId = lead.Id;
    Assert.IsTrue(service.ValidEntityId(newLeadId));
}
  • No labels