1

I have a formula field which is a check box that automatically is ticked/not ticked depending on the formula criteria. This formula field works perfectly for me.

Although i have various workflows which i am trying to set-up which are based upon the result of this formula field. I have tried various aspects for getting this to work but cannot seem to fix this, has anyone any suggestions?

Currently my workflow criteria is:

ISPICKVAL(Active_Client_c,"Yes") && Formula_Field_c <> null    

I have looked for previous questions but none of the solutions seem to work for me as there is no manual interaction from anyone to change the Formula_Field as its automatic. The current method only works when someone has edited/modified the record in question but I need this to work automatically even if a record has not been edited. Any help is greatly appreciated.

Many Thanks

1 Answer 1

0

As you write in the comments, your formula field looks like this:

(Client_Review_Due_Date__c < TODAY()) && (!Review_Submitted__c)

And you want the workflow to fire when the formula field evaluates to true *1. However, as you notice, the workflow does not trigger when the formula field changes.

That is because the formula field does not actually 'change' or have a stored value: it is calculated on the fly and only if you actively ask for it, e.g. when you view the page or query for it in SOQL.

So my suggestion would be not to use the formula field at all. If you want the workflow to fire when the Client_Review_Due_Date__c < TODAY(), then it is better to rewrite the workflow as

ISPICKVAL(Active_Client_c,"Yes") && !Review_Submitted__c

And then plan time-dependent actions that will fire 7 days after Client_Review_Due_Date__c, 10 days after Client_Review_Due_Date__c etc.

That is safe, because if the workflow criteria won't match, the planned actions will be removed from the queue and the emails will not be sent.

*1: I assume you mean to say == True instead of <> null...

21
  • Thank you for your reply. Would this mean to create a field and have the field auto update with something to fire the other workflows. Would could this be?
    – Chris
    Sep 17, 2015 at 9:52
  • You usually don't need an additional field, as you can e.g. do a DML update without changing anything (Trigger) or do a field update on the Name field and fill it with the current Name (Workflow). Sep 17, 2015 at 10:05
  • The takeaway is that you can only work from the 'source' of the change, i.e. the record that is actually changing, and then actively bubbling up from there. A formula field doesn't work for triggering workflow criteria because it is only calculated 'on request' (e.g. when it is shown on a page or queried via SOQL) and doesn't trigger anything by itself. Sep 17, 2015 at 10:07
  • Thank you Willem for your help, so just to confirm as i would be using a workflow and not an Apex Trigger. I would create a field update on a field such a the name field and set this to fill with the current name each day? Would this fix my problem. Does the field that is being updated have to be a certain field type and i would need to set it to re-evaluate workflows after change, is that correct?
    – Chris
    Sep 17, 2015 at 10:11
  • Sorry also when the field is set to update, do i need then to have a work to tell the field when to update?
    – Chris
    Sep 17, 2015 at 10:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .