You need to sign in to do that
Don't have an account?
Christian Kendall 10
How to write Apex code for Lead Create Date + 15 Minutes
Hello Salesforce Community - First post #1!
Business Goal : 15 minutes after a lead is created from a web-to-lead form I'd like to reassign the lead to a queue if the SDR has not updated the lead status from default value of "Not Started".
Problem : Process builder doesn't allow you to use conditions based on custom formula fields which would display the created time and compare to the time now.
Solution : Write Apex code, have that code populate a field on the lead object indicating the created date/time + 15 minutes. Then process builder can evaluate the created date time to see if Now () created date is greater than the created date + 15 minutes. This would allow for the conditions to be met and the record owner updated to the queue.
Can someone please help me write this code and understand how to push it to the field on the lead object which is not going to be a formula.
Business Goal : 15 minutes after a lead is created from a web-to-lead form I'd like to reassign the lead to a queue if the SDR has not updated the lead status from default value of "Not Started".
Problem : Process builder doesn't allow you to use conditions based on custom formula fields which would display the created time and compare to the time now.
Solution : Write Apex code, have that code populate a field on the lead object indicating the created date/time + 15 minutes. Then process builder can evaluate the created date time to see if Now () created date is greater than the created date + 15 minutes. This would allow for the conditions to be met and the record owner updated to the queue.
Can someone please help me write this code and understand how to push it to the field on the lead object which is not going to be a formula.
Please use the below trigger on Lead object:
Created a custom Date Time field on Lead object and added the below trigger.
I also tested the above code in my DE environment and it is working fine.
Please do let me know if it helps you.
Regards,
Mahesh
How do I enable triggers to be added?
Which edition you are using in PA you can't write the Apex Code.
Regards,
Mahesh
Do you mean to say that the Salesforce edition we have "PA" doesn't allow for us to add Apex code? Are there any work arounds?
-Christian