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
oceanofstarsoceanofstars 

how to fire a trigger after the workflow

I wrote a trigger which compares old values and new values in it.  This trigger is sending http request to another system. Some values are updated to a new values by work flow rule. So, when we change some value trigger fires in sending the http request and work flow updates some fields. So, the trigger again fires after the work flow rules and sends the value through http request. but this times it is sending previous value and the values which are updated through work flow rule. So my question is, Is there any way to stop the sending previous value twice(first time trigger fires and the after workflow trigger fires again) or is there any way to fire a trigger just once after the workflow rules.

steve456steve456

Write the logic of workflow in the trigger and deactivate the wrkflow

DeepeshDeepesh

Ya, either remove workflow or use a flag on object. Set that flag when you send the first hhtp request. So next time, trigger checks the value of the flag and doesn't do anything.