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
dho1dho1 

How to emulate the time based workflow via Apex?

Is there any way to do this? The only reason I want to do this because I cannot set CC's on an workflow email alert.

 

TIA!

 

 

Best Answer chosen by Admin (Salesforce Developers) 
HariDineshHariDinesh

Hi,

 

In the Email Alert you can set 5 additional Email Addresses, is it not suitable of not fit for your requirement..?

 

If not you need to do well enough coding for this and can do in different ways

 

1)Create a work flow with required Entry criteria and Evolution criteria and with required actions.

    (Except that Email alert, if any..).

2)write Apex code to create one record and insert a record in to DB such that it meets criteria of WF.

3)Now write code for Sending Email in Apex as you required.

 

This approach will be best for you which need less amount of coding.

All Answers

HariDineshHariDinesh

Hi,

 

In the Email Alert you can set 5 additional Email Addresses, is it not suitable of not fit for your requirement..?

 

If not you need to do well enough coding for this and can do in different ways

 

1)Create a work flow with required Entry criteria and Evolution criteria and with required actions.

    (Except that Email alert, if any..).

2)write Apex code to create one record and insert a record in to DB such that it meets criteria of WF.

3)Now write code for Sending Email in Apex as you required.

 

This approach will be best for you which need less amount of coding.

This was selected as the best answer
dho1dho1

Thanks and keep up the good work HariDinesh!