You need to sign in to do that
Don't have an account?
Inbox Outbox
Helper class to create three tasks from lead if lead's firstname, lastname and website are not null
Really appreaciate your input.
If at least 3 key fields (firstname, lastname and website)are populated, create a new Task for each key field populated:
The name of each Task should be: Verify the <<key field name>> field.
I can create one task but I am not sure how to create three task for each field.
Not completed code: Below is my helper class:
public class keyFieldsPopulatedHelper {
List <task> TaskLead= new list <task>();
public static void keyFieldsPopulatedHelperMethod(list<Lead> LeadList){
for(Lead L: LeadList){
if(L.Key_Fields_Populated__c >=3){
Task T= New Task();
T.WhatId= L.Id;
}
}
}
}
If at least 3 key fields (firstname, lastname and website)are populated, create a new Task for each key field populated:
The name of each Task should be: Verify the <<key field name>> field.
I can create one task but I am not sure how to create three task for each field.
Not completed code: Below is my helper class:
public class keyFieldsPopulatedHelper {
List <task> TaskLead= new list <task>();
public static void keyFieldsPopulatedHelperMethod(list<Lead> LeadList){
for(Lead L: LeadList){
if(L.Key_Fields_Populated__c >=3){
Task T= New Task();
T.WhatId= L.Id;
}
}
}
}
Greetings!
Please refer to the below link, I hope it would be helpful to you.
https://developer.salesforce.com/forums/?id=9062I000000IP9bQAG
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi
All Answers
Please check out this similar requirement addressed on below thread:
https://developer.salesforce.com/forums/?id=9062I000000g5CBQAY
Hope information over it helps you to implement the same. Please mark as Best Answer so that it can help others in future.
Thanks.
Greetings!
Please refer to the below link, I hope it would be helpful to you.
https://developer.salesforce.com/forums/?id=9062I000000IP9bQAG
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi
Try below sample code from post
https://developer.salesforce.com/forums/?id=9062I000000IP9bQAG