/
Update an Existing Lead
Update an Existing Lead
Using the SOjbect Id of an existing Lead to set a new field value. If there is an active connection to Salesforce, then it will also be populated in Salesforce, otherwise Leads should be configured for synchronization.
Id leadId = new Id("00Q2800000fgxkKEAQ"); Lead lead = new Lead(leadId); lead.LastName = "Smith"; GenericMongoService service = new GenericMongoService(Lead.SFType); SaveResult saveResult = service.UpdateEntity(lead); if (saveResult.success) { Assert.AreEqual(leadId, (Id)saveResult.id); }