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
phil_MDIphil_MDI 

reference workflow from apex

Is it possible to reference/touch workflow tasks from apex?  the scenario is, I want to monitor an event for an object that a standard workflow rule can not handle.  so I could do a trigger to monitor the event.  Once that events happens I would liek to reference the workflow task or task template and create it in the system.

 

I know I could create the task from apex, however i would prefer to keep the "task template" edits point and click, not code.  Also the task could be used by other workflow rules.

 

 

phil_MDIphil_MDI

fyi: I did try SOQL the task table for the ID of the workflow task in Salesforce...but got no result.   Is it possible it's in a different table/object?

Andy BoettcherAndy Boettcher

The Workflow Processes and Actions are not accessible via APEX.  You can only access workflow rules related metadata via the Metadata API.

 

-Andy