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
JimAJimA 

Workflow Rule Object through the API

Hi there,
 
Does anyone know if you can activate a workflow rule through the API?  I can't find any objects listed in the documentation and I'm looking for a way to turn on and off a work flow rule with a script at a specific time of day.  You can't specify a timezone in the workflow and we are looking to turn one on at 7pm friday EST and Turn it off Sunday 7pm EST.
 
Thanks!
Park Walker (TAGL)Park Walker (TAGL)
One way to solve the problem would be to add a new formula field to the object that's triggering the workflow. Have the formula work with the LastModifiedDate field (a time stamp) to return true if the rule should fire, false if not. Then add a new criteria to your workflow rule to test the calculated value. If you base the time calculation on the GMT equivalent it should do what you want. It would mean updating the rule twice a year, unless you can figure out how to adjust for daylight savings time.

Park