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
Ishan Singh 4Ishan Singh 4 

I have created a task using batch class and now I want to create followup task using process builder but getting this error.

Error element myRule_1_A1 (FlowRecordCreate).
This error occurred when the flow tried to create one or more records: The flow failed to access the value for myVariable_current.Lead__r.Id because it hasn't been set or assigned.. You can look up ExceptionCode values in the SOAP API Developer Guide (" style="color:blue; text-decoration:underline).
I have mentioned below details in Task created by batch class 
Task C = new Task();
            C.Subject= 'xxx';
            C.ActivityDate =;
            C.OwnerId = l.OwnerId;
            C.Type = 'yyy';   
I am creating process builder correctly 

ShirishaShirisha (Salesforce Developers) 
Hi Ishan,


I can see that you have setup the whoId to assign it to the Lead record but can you please double check,if you are passing the lead record for lead in the Process builder.

Please make sure that the Lead l variable has any value or set to any variable to pass the recordId.

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

Warm Regards,
Shirisha Pathuri