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
MattymooMattymoo 

Can a trigger that creates an object, invoke a workflow rule?

Hi

I have an APEX trigger that creates a record.

I want to send an email after the creation of that record.

I have set-up a workflow rule that responds to these newly created records, but this does not fire from the trigger. (it works if I manually create the record)

Is this an order of execution issue?

i.e. does it not submit the record created by the trigger until after the workflows rules have been executed?

Is there anyway to get this working without having to code the send email?

Many thanks

Madhan Raja MMadhan Raja M

Hi Mattymoo,

 

I am not sure why the workflow is not triggered but this link might help you:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm?fromSearch=true

 

Madhan Raja M

 

 

ar_sfdcar_sfdc

Hi MattyMoo,

 

It would help if you provide more details or the code of your trigger. According to the details you have provided, the workflow rules should fire.

 

Regards,

 

Arun

SammyComesHereSammyComesHere

If it is a recursive save , it wont.  Refer  Docs

 

 

Please ensure that you are not making a recursive call from inside the Trigger.

SammyComesHereSammyComesHere

Please do ensure both the workflow rule is activated. :) Other wise should work if not a recursive call on same object