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
GorkyGorky 

Time-Dependent Workflow running out of time

Hi,

 

I put a  Time-Dependent Workflow with the condition "1 Day Before Opportunity: Contract Start Date", then must send an email just a day before. It does, but also...if I modify the opportunity and the actual date if more than the "start date", another mail is sended, but it must not happpen.

 

Anyone knows how to manage this issue?

 

Thanks.

 

sfdcfoxsfdcfox

You could have a custom field track if this has already been sent. For example, you could have a checkbox, off the field layout entirely, with a default value of false. The time delayed workflow rule could update the field value at the same time as sending the email. The filter for the rule would include this custom field.

 

A more complex method that may work could be to just use a formula to check and see if the field meets certain conditions. For example, you could specify, through a formula, that it works only when the record is new or when the date is in the future but was not in the past. Of course, this isn't as foolproof, but should probably be sufficient in most cases. I would imagine it would look like this:

 

AND( OR( ISNEW(), PRIORVALUE(ActualDate__c) > TODAY() ), ActualDate__c > TODAY() )

Your milage may vary.