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
DaFFyDaFFy 

Workflow Rule for High Budget Short Flight Dates

Hi

 

I'm trying to get a workflow rule to work but am having some trouble with my rule criteria.

 

I'm trying to send an email alert when the below criteria is met.

 

budget  >= $10,000.

flight days <= 5 days

 

Tried this but it's not working: 

AND((End_Date__c - Start_Date__c) <= 5, ( UnitPrice >= 10000))

 

Any help would be appreciated. Thank you.

Steve :-/Steve :-/

Can you post your WFR? (not just the formula)

DaFFyDaFFy

Absolutely. And also slightly different. The object is the oppty product.

 

An email alert will be triggered when the unit price is greater than or equal to 10000 and the flight date is less than or equal to 5 days and oppty stage is set to closed won. 

 

In the sandbox it was spitting out an ex. email alert every few hrs randomly so i probably made a mistake somewhere.

shruthishruthi

I believe this can satisfy your criteria:

AND((End_Date__c - Start_Date__c) <= 5, ( UnitPrice >= 10000),(StageName = 'Closed'))

 

Also choose the Evaluation criteria to be "When a record is created, or when a record is edited and did not previously meet the rule criteria" to prevent sending emails each time the Opportunity is edited.

 

 

DaFFyDaFFy

Thanks Guys!

DaFFyDaFFy

Actually it's giving me an error with the stagename bit. This is off of the opportunity product not the opportunity. and the error is saying stagename is not a field

shruthishruthi

Try this!

AND((End_Date__c - Start_Date__c) <= 5, ( UnitPrice >= 10000),ISPICKVAL( Opportunity.StageName , 'Closed'))

 

 I am assuming that End_Date__c, Start_Date__c and UnitPrice are fields on Oppty Product. Else, you need to include something like Opportunity.End_Date__c........

DaFFyDaFFy

Yep at the Oppty prod level. Thanks! will try this out!

DaFFyDaFFy

For some reason this rule did not send an email alert. the opportunity product line item met the criteria as the flight dates was just running one day and had a budget over $10k and the opportunity was closed.

 

AND((End_Date__c - Start_Date__c) <= 5, ( UnitPrice >= 10000),ISPICKVAL( Opportunity.StageName , 'Closed'))

 

The start and end dates was for the same day.