0

Hello I am new to salesforce, I have to put a validation rule on a custom field (Deposit Date), There are 2 conditions:
1-Deposit date not exceed the current date
2-Deposit date not before 26 of previous month

  • Hi @Atul, welcome to SFSE! Please take a moment to visit the help center, scroll through the tour, and read How to Ask. – SE_User May 23 '17 at 4:30
  • For questions like these (you are just starting to learn a specific part of Salesforce), it's usually better to see if there is anything that can help you over on Trailhead. Trailhead is much better suited for teaching the basics, and there is a module on validation rules. – Derek F May 23 '17 at 12:45
1

You can use the below formula, It should work : -

AND( 
Deposit_date__c > TODAY(), 
Deposit_date__c <DATE(YEAR(TODAY()),MONTH(TODAY())-1,26) 
)
|improve this answer|||||
  • There a fair chance of today being a date on January where you need to check against '26-Dec-Previous year'. – Saumya Ranjan Satapathy May 23 '17 at 9:03
  • Its not working yet – Atul May 24 '17 at 13:39
  • For what scenario it is not working? – Avijit Das May 24 '17 at 18:42
  • when i submit next date to current date it not show any error – Atul May 25 '17 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.