Convert Leads Using Skuid

Skuid currently does not provide an API method for converting Leads into Accounts/Contacts/Opportunities, so it would take extensive custom coding for a user to override the standard “Convert Lead” page with a corresponding Skuid page. However, if it were possible to use a Skuid page to achieve this, it could be incredible powerful. Consider some ways this could be used:

  • Mass Convert: the convertLead capability could be exposed as a Mass Action, so that multiple Leads could be selected and “Mass-Converted”, with only one Account being created, but multiple Contacts being created, and one or multiple Opportunities being created.
  • Leverage Skuid’s lookup filters / autocomplete / picklist rendering options to improve the experience of searching for existing Accounts / Contacts to associate with.
  • Allow for creation of Opportunity Products right from the Convert screen.
  • Define a custom “Create Task” process.
  • Allow for explicit selection of Account/Contact/Opportunity Record Types that you’d like to use during the Conversion, rather than having to create Workflow Rules.
  • Have completely different ConvertLead screens based on User Profile / Lead record type
via zachelrath on

HI, I found this suggestions when trying to find my own post. I recently created a custom skuid convert lead popup from the leads page. The standard SalesForce api actually provides a one line method to convert the lead. In the code below I added a ‘New opportunity’ model to the lead page that contains the properties for the new opportunity created during the lead convert process.

var params = arguments[0]; var lead = skuid.model.getModel('Lead'); var leadId = lead.getFieldValue(lead.getFirstRow(), 'Id'); var leadConvert = new sforce.LeadConvert(); leadConvert.leadId = leadId; leadConvert.convertedStatus = 'Qualified'; // XXX var result = sforce.connection.convertLead([leadConvert]); var opportunityId = result[0].opportunityId; var accountId = result[0].accountId; var newOpportunity = skuid.model.getModel('New Opportunity').getFirstRow(); var o = new sforce.SObject('Opportunity'); o.Id = opportunityId; o.Name = newOpportunity.Name; o.Description = newOpportunity.Description; o.StageName = newOpportunity.StageName; o.CloseDate = newOpportunity.CloseDate; sforce.connection.update([o]); top.location = '/' + accountId;