コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: Database.cs プロジェクト: jayonsoftware/apexsharp
 public static LeadConvertResult convertLead(LeadConvert leadConvert, bool allOrNothing)
 {
     throw new global::System.NotImplementedException("Database.ConvertLead");
 }
コード例 #4
0
ファイル: Database.cs プロジェクト: jayonsoftware/apexsharp
 public static LeadConvertResult convertLead(LeadConvert leadConvert, object DmlOptions)
 {
     throw new global::System.NotImplementedException("Database.ConvertLead");
 }
コード例 #5
0
ファイル: Database.cs プロジェクト: yallie/ApexSharp
 // API
 public static LeadConvertResult convertLead(LeadConvert leadToConvert, bool allOrNone)
 {
     return(Implementation.convertLead(leadToConvert, allOrNone));
 }
コード例 #6
0
ファイル: Database.cs プロジェクト: yallie/ApexSharp
 public static LeadConvertResult convertLead(LeadConvert leadConvert)
 {
     return(Implementation.convertLead(leadConvert));
 }
コード例 #7
0
ファイル: Database.cs プロジェクト: yallie/ApexSharp
 public static LeadConvertResult convertLead(LeadConvert leadConvert, DMLOptions DmlOptions)
 {
     return(Implementation.convertLead(leadConvert, DmlOptions));
 }