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
nclaynclay 

"IF" Validation Rules

I'm having difficulty finding appropriate validation rule examples to build from. 

  1. I'd like to create a validation rule indicating that if the Opportunity Stage equals Revist that the Close Date cannot exceed one year from today.  Is that possible? 
  2. I have Professional Edition so user permissions are a bit different.  I would like to create another rule indicating that if you are not a system administrator you cannot delete Opportunities.  Is that possible?

Any help would be greatly appreciated!

N

Best Answer chosen by Admin (Salesforce Developers) 
Kent ManningKent Manning

Hi nclay,

 

I tried this validation rule on my development org and it worked OK.

 

If (  ISPICKVAL(StageName, "Revisit" ),
  If( CloseDate  >=  TODAY() +365, True, False),
False)

 

I put the message next to the Close Date and said something like: "Close Date must not be greater than one year from today."

 

 

As for your second question, I'm not familiar with Professional Edition, but I would think you could go to the user profiles, uncheck the delete box on the rights for opportunities. This would effectively keeping users from deleting opportunities.

 

Hope these suggestion help.

 

 

 

 

All Answers

Kent ManningKent Manning

Hi nclay,

 

I tried this validation rule on my development org and it worked OK.

 

If (  ISPICKVAL(StageName, "Revisit" ),
  If( CloseDate  >=  TODAY() +365, True, False),
False)

 

I put the message next to the Close Date and said something like: "Close Date must not be greater than one year from today."

 

 

As for your second question, I'm not familiar with Professional Edition, but I would think you could go to the user profiles, uncheck the delete box on the rights for opportunities. This would effectively keeping users from deleting opportunities.

 

Hope these suggestion help.

 

 

 

 

This was selected as the best answer
nclaynclay

Thank you so much - the validation rule worked perfectly! 

 

Professional edition doesn't have the delete box on the rights for opportunities.  I'll keep trying to work out an alternate solution for that.

 

Again, thank you so much for the help.  Have a great day - you made mine!