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
cldavecldave 

Rule Criteria Question

Hi i have on Opp. a Date/time field called "reminder email"

 

Now i set up a workflow rule with a time trigger to send an email according to that date/time field (0 hours after date/time field) and chose: When a record is created, or when a record is edited and did not previously meet the rule criteria and criteria are met

the criteria is "reminder email" not equal to : blank

 

now my problem is if that date is changed, a new time based workflow will not be created for the new date, unless i erase that field , save the page, then put in a new date/time

 

could i use maybe a: formula evaluate to true type of criteria?

 

with maybe like a formula that says: whenever new value not equal to old value fire workflow rule?

 

if that is good or if you have any other solution, please let me know how

 

Thx

Best Answer chosen by Admin (Salesforce Developers) 
thomastthomast

Your underlying assumption, while intuitive, is incorrect. If you change the date/time field, the time-based workflow will recalculate, even if that date/time field was filled before. You can test this in the following way:

 

 

  1. Create an Opportunity such that the workflow will fire.
  2. Go to Setup -> Admin Setup -> Monitoring -> Time-Based Workflow. Click Search, or if you have a lot of time-based workflows, set the filters and then search, so you can see the pending workflow email.
  3. Note the Scheduled Date.
  4. Go back to the Opportunity. Edit & save it, changing only the Reminder Email date time field.
  5. Go back to the Time-Based Workflow monitoring. The Scheduled Date for the workflow will have updated based on the new value in the Reminder Email field.

 

All Answers

Steve :-/Steve :-/

Instead of using Rule Criteria, I would use a Formula that uses ISCHANGED and PRIORVALUE to evaluate the Reminder Date and recalculate the Email Alert.  

 

I try to stay away from using WFR Criteria unless it is a really simple trigger.

cldavecldave

Unfortunately, as i was trying this method this morning i got the following errors

 

Function PRIORVALUE may not be used in this type of formula

 

Function ISCHANGED may not be used in this type of formula

 

just to make sure we are on the same page, what i'm tryng to do is create a rule: formula evaluates to true

 

that the date/time has changed and to create a new time-based workflow

 

thx

Steve :-/Steve :-/

When is your WFR Firing?  PRIORVAL and ISCHANGED can only be used if it's set to Every Time the Record is Edited.

cldavecldave

Ok i did not know that

 

but it won't work for me as this needs to be a time based workflow , i need the WFR to be fired on the date and time of that field (reminder email) which is always in the future.

 

and when i select Every time a record is created or edited it tells me:

You cannot add time-dependent workflow actions with this option.

<script type="text/javascript"></script>

<script type="text/javascript"></script>

<script type="text/javascript">// Thx anyways :) if (window.sfdcPage) sfdcPage.registerMessage('noTimeDependentActionsInfo'); // </script>

Steve :-/Steve :-/

Can you post a screenshot of your WFR?

cldavecldave

here's 2 screenshot, let me know if need additional

 

 

http://img600.imageshack.us/i/25106629.jpg/

 

http://img829.imageshack.us/i/98506900.jpg/

 

 

 

 

thx

 

 

Steve :-/Steve :-/

Sorry Dave, but I got a suspicious pop-up message when I clicked on those links, so I don't really trust that site.  

 

Can you just emded the screenshots using either the upload image link, or url link like this?  

cldavecldave

Ok it doesn't work like a forum :)

 

thomastthomast

Your underlying assumption, while intuitive, is incorrect. If you change the date/time field, the time-based workflow will recalculate, even if that date/time field was filled before. You can test this in the following way:

 

 

  1. Create an Opportunity such that the workflow will fire.
  2. Go to Setup -> Admin Setup -> Monitoring -> Time-Based Workflow. Click Search, or if you have a lot of time-based workflows, set the filters and then search, so you can see the pending workflow email.
  3. Note the Scheduled Date.
  4. Go back to the Opportunity. Edit & save it, changing only the Reminder Email date time field.
  5. Go back to the Time-Based Workflow monitoring. The Scheduled Date for the workflow will have updated based on the new value in the Reminder Email field.

 

This was selected as the best answer
cldavecldave

Well Thomas Thank you very much :) you are a 100% right!!!

 

I was breaking my head and Steve's head for nothing.

 

Well life is a learning experience....

 

Thx all of you