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
2 respostas
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:
Best Regards
Ram