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
javierjiesjavierjies 

Opportunity limit Close Date

Hello everyone!!

 

In my company, we would like to have a limit close date for our opportunities of three monhs.

 

Is there any way (preferibly without encoding) to restrict the opportunity close date until three months from today?

 

Thanks in advance!!

Best Answer chosen by Admin (Salesforce Developers) 
Jeremy.NottinghJeremy.Nottingh

Does this do what you need?

 

 

AND(
  OR(
     ISNEW(),
     ISCHANGED( CloseDate )
    ),
  (
     CloseDate > 
       (IF(
          MONTH(TODAY()) < 10,
          DATE( YEAR(TODAY()), (MONTH(TODAY()) + 3), DAY(TODAY())),
          DATE( YEAR(TODAY()) + 1, (MONTH(TODAY())  - 9), DAY(TODAY()))
          )
   )
))

 

 

Regards,

Jeremy

All Answers

DodiDodi

You should be able to do this in a standard validation rule.

 

Regards

javierjiesjavierjies

Yes, may be with a formula, but It's not that easy if you want to control Opportunities, for example, in November...

Jeremy.NottinghJeremy.Nottingh

Does this do what you need?

 

 

AND(
  OR(
     ISNEW(),
     ISCHANGED( CloseDate )
    ),
  (
     CloseDate > 
       (IF(
          MONTH(TODAY()) < 10,
          DATE( YEAR(TODAY()), (MONTH(TODAY()) + 3), DAY(TODAY())),
          DATE( YEAR(TODAY()) + 1, (MONTH(TODAY())  - 9), DAY(TODAY()))
          )
   )
))

 

 

Regards,

Jeremy

This was selected as the best answer