function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SriRamya BeramSriRamya Beram 

Not receiving email notification on task creation while auto conversion lead

For manually created leads task assignments are creating and email notifications are firing. Here we are using processbuilder for task creation  but the process builder is not working properly where we want to creat a task for opportunity which is coming from auto conversion of lead here task is creating successfully but email notifications are not working
Khan AnasKhan Anas (Salesforce Developers) 
Hi SriRamya,

I trust you are doing very well.

It was a known issue but Salesforce fixed it: https://success.salesforce.com/issues_view?id=a1p300000010wFNAAY

According to Salesforce:
This is not a bug, but a feature limitation with process builder

Workaround:
Use workflow instead of process builder


I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in future.

Thanks and Regards,
Khan Anas
SriRamya BeramSriRamya Beram
Thanks Khan Anas for your quick responce,Here our requirment is we need to append the opportunity fields in task subject, As per my knowledge in workflows we can't append the dynamic values to task. So i need solution for this.
Raj VakatiRaj Vakati
The only option is you have to write the trigger .... sample code is here 
 
trigger AutoConverter on Lead (after insert) {
       Set<Id> oppLead = new Set<Id>();

 for (Lead lead: Trigger.new) {
      if (!lead.isConverted) {
              oppLead.put(lead.convertedOpportunityId);

      }
 }

 List<Task> insertTask = new List<Task>();

 if (!oppLead.isEmpty()) {
    For(Opportunity op : [Select Id , Name from Opportunity where Id IN :oppLead]){
	// Create a Task
	
	Task newTask = new Task();
newTask.subject = 'New Opportunity Task'+op.Name ; 
newTask.whatId = newCase.Id;
newTask.whoId=op.Id;
newTask.ownerId = newCase.OwnerId;
newTask.status = 'In progress';
newTask.Priority = 'Normal';
insertTask.add(newTask);
	}
	
	insert insertTask;
 }
 }