+ Start a Discussion
bluecapbluecap 

Partner API using leadConvert()

Hello,

I am having trouble getting to the next step with lead conversion, specifically with bulk lead conversions in my .Net integration. How do I bulk them together using the Partner API? Here's what I have so far for lead conversion...as well as what Im using for my working insert operation for comparison. Thanks ahead of time for the assistance.

        public LeadConvertResult[] performLeadConvert(LeadConvert[] leadsToConvert)
        {
            LeadConvertResult[] results = new LeadConvertResult[leadsToConvert.Length];

            results = binding.convertLead(leadsToConvert);
           
            return results;
        }

Working insert method...

public List<SaveResult> performInsert(List<sObject> sObjectRecs)
        {
            List<SaveResult> results = new List<SaveResult>();
            if (sObjectRecs.Count <= 200)
            {
                results = binding.create(sObjectRecs.ToArray()).ToList();
            }
            else
            {
                Int32 i = 0;
                List<sObject> iterSObjects = new List<sObject>();
                foreach (sObject s in sObjectRecs)
                {
                    if (i < 200)
                    {
                        iterSObjects.Add(s);
                        i++;
                    }
                    else
                    {
                        results.AddRange(binding.create(iterSObjects.ToArray()).ToList());
                        i = 0;
                        iterSObjects = new List<sObject>();
                    }
                }
                results.AddRange(binding.create(iterSObjects.ToArray()).ToList());
            }
            return results;
        }
bluecapbluecap
Think I may have found the solution. I'll post it once I can confirm.