Make a quick vote 🗳 ️How do you refer to SuiteCRM extensions: add-ons or plug-ins? Click here to have your say 👈

Using workflow to update field help needed

Hi there

I have created a workflow that runs every 5 minutes.
What I need it to do is Minus 5 from a field every 5 minutes to enable a sort of rundown timer functionality.

For now I have it working to modify the field “Minutes” to 30.
What I need it to do is change it to (Field:[Minutes]-5)
Not sure what the correct syntax to use is, or is this even possible?

So every 5 minutes the field “Minutes” is reduced by 5.

Hi,
you have to choose “calculate fields” as action. Then you add the starting value (the field that is storing your integer) as the first parameter, so it is usually {P0}. Under “formulas”, select the same field (as the new value should be applied to the same field). The formula to use is then:

{subtract({P0}; 5)}

Explanation: Every time the workflow is triggered, use value {P0} and subtract 5. As we chose the the same field under “formula”, the new value is written to that field and is used the next time as {P0}.

I did test that formula with a regular workflow that is triggered by saving and it was working nicely. You can read more about calculated fields here:

And, of course, you could do the same feature as a scheduled job, but this would require some coding.

Working!!!
Thanks alot