public string ConvertLeadToOpportunity(string leadId, string accountId, string opportunityName) { var leadConvert = new LeadConvert(); leadConvert.leadId = leadId; if (!string.IsNullOrEmpty(accountId)) leadConvert.accountId = accountId; leadConvert.opportunityName = opportunityName; leadConvert.convertedStatus = "Qualified"; leadConvert.sendNotificationEmail = false; string returnString = ""; var lcr = binding.convertLead(new[] {leadConvert}); foreach (var t in lcr) if (t.success) { Debug.WriteLine("Conversion succeeded.\n"); Debug.WriteLine("The new opportunity id is: " + t.opportunityId); returnString += t.opportunityId + " "; } else { throw new Exception("The conversion failed because: " + t.errors[0].message); } return returnString.Trim(); }
public void LeadConvertClass_Properties_TestGetterAndSetter() { // Arrange var testEntity = new LeadConvert(); var privateObject = new PrivateObject(testEntity); var propertiesDictionary = new Dictionary <string, object>() { ["accountId"] = DummyString, ["contactId"] = DummyString, ["convertedStatus"] = DummyString, ["doNotCreateOpportunity"] = true, ["leadId"] = DummyString, ["opportunityName"] = DummyString, ["overwriteLeadSource"] = true, ["ownerId"] = DummyString, ["sendNotificationEmail"] = true, }; // Act SetProperties(privateObject, propertiesDictionary); // Assert AssertProperties(privateObject, propertiesDictionary); }
public static LeadConvertResult convertLead(LeadConvert leadConvert, bool allOrNothing) { throw new global::System.NotImplementedException("Database.ConvertLead"); }
public static LeadConvertResult convertLead(LeadConvert leadConvert, object DmlOptions) { throw new global::System.NotImplementedException("Database.ConvertLead"); }
// API public static LeadConvertResult convertLead(LeadConvert leadToConvert, bool allOrNone) { return(Implementation.convertLead(leadToConvert, allOrNone)); }
public static LeadConvertResult convertLead(LeadConvert leadConvert) { return(Implementation.convertLead(leadConvert)); }
public static LeadConvertResult convertLead(LeadConvert leadConvert, DMLOptions DmlOptions) { return(Implementation.convertLead(leadConvert, DmlOptions)); }