Skip to main content
i got scenario like whenever lead is create based on values account and contact should be create. this will we can achieve from process builder but 

 

how can we make parent account for the contact which i created from process bulder

 

even i did schedule action for the contact but i am not getting

 

can any one please help

 

process builder

 

User-added image​​​​​​​
2 respuestas
  1. 12 sept 2020, 16:32
    Hi Prashant,

     

    Lead Conversion is a standard automation rule given by salesforce. But to use that, you have to ask the customer to covert the lead manually.

     

    In case if you have a criteria based conversion then you can still use Process Builder  and call a apex method in actions instead of creating  Account and Contact  seperately.

     

    You can use the below class for the conversion:

     

    Public class AutoConvertLeads

     

    {

     

        @InvocableMethod

     

        public static void LeadAssign(List<Id> LeadIds)

     

        {

     

            LeadStatus CLeadStatus= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];

     

            List<Database.LeadConvert> MassLeadconvert = new List<Database.LeadConvert>();

     

            for(id currentlead: LeadIds){

     

                    Database.LeadConvert Leadconvert = new Database.LeadConvert();

     

                    Leadconvert.setLeadId(currentlead);                

     

                    Leadconvert.setConvertedStatus(CLeadStatus.MasterLabel);

     

                    Leadconvert.setDoNotCreateOpportunity(TRUE);

     

                    //Remove this line if you want to create an opportunity from Lead Conversion 

     

                    MassLeadconvert.add(Leadconvert);

     

            }

     

            

     

            if (!MassLeadconvert.isEmpty()) {

     

                List<Database.LeadConvertResult> lcr = Database.convertLead(MassLeadconvert);

     

            }

     

        }

     

    }

     

    Call the above method in your process builder as per below screen shot:

     

    Hi Prashant, Lead Conversion is a standard automation rule given by salesforce. But to use that, you have to ask the customer to covert the lead manually.

     

    Best Regards

     

    Ram
0/9000