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
WycadoWycado 

Workflow Not Triggering on Field Update

I have tried in several different ways to accomplish the following without Apex.

 

1. A custom "Contract End Date" field is equal to Today

2. A workflow triggers, and sends an email notification that the contract expires today

 

What I run into here is that a workflow field update is not an "edit" of a record. When the "Contract End Date" equals Today, have a formula text field called "Contract Trigger" change value with the logic "if( Contract_Trigger__c =Today(),"Fire Away",""). This works fine. When the "Contract End Date" is today, the "Contract Trigger" field assumes the value "Fire Away".

 

My workflow then keys off of the "Contract Trigger" with the logic "NOT(ISBLANK( Contract_Trigger__c ) )". 

 

The problem is that even though the workflow properly fires the day the contract expires , and the "Contract Trigger" is changed to "Fire Away", it's not considered an "edit" of the record, and the workflow does not re-evaluate and send the email. It all works fine if I manually edit the record, but it can't sit there, wait until the date, and properly fire. 

 

I believe I need Apex to do this. This is a very common situation. I would appreciate any help in how to accomplish this. 

piyush parmarpiyush parmar
Hi,

Work flow will execute only if the "Rule Criteria" match.
it's 3 criteria in this 3 criteria rule it will not execute.
If you can add time base trigger OR scheduler class to execute base on condition.
Please let me know your requirement.
Thanks
WycadoWycado

Your answer makes no sense to me. There is not 3 criteria in the workflow - it is set to trigger on the criteria "NOT(ISBLANK( Contract_Trigger__c ) )", and the Contract_Trigger__c field is a formula text field. 

 

The problem here is that standard workflow can't sit there and 'wait' for a field value. The record must be edited to re-evaluate the workflow. I need Apex to do this. 

 

piyush parmarpiyush parmar
That's why I mention to write scheduler class, So it will execute base on your criteria rule and date match.