0

I am having this issue that when I close own the opp. the CloseDate do not change to today's date automatically but stays the same in future date. Like in the picture

I do not know what is the issue here. According to SF, CloseDate is Defined Is there any configurations messing with our Org that is preventing this standard feature of SF to change the future date to today when the opp. is closed?

I am trying to base the actual closing date to validate the opp. so it cannot be reopened by certain user type after 3 days of it actual closing date. I have looked into the web but have not found the solution, Some input from experienced users like you here in the community would be great help.

validation rule example that is used.

    AND(
$User.Alias <> 'aaa' ,
$User.Alias <> 'bbb',
$User.ProfileId = '00exxxxxxx',/*System Administrator*/
$User.ProfileId <> '00exxxxxxx', /*Finance Administration*/
PRIORVALUE(IsClosed) = TRUE,
ISCHANGED(StageName),
!ISPICKVAL(PRIORVALUE( StageName ), "aaa Won"),
$User.Email <> "[email protected]"
)

The Other validation rule

AND(
ISPICKVAL(PRIORVALUE(StageName),"Closed Won"),
IsAutomationBypassed__c = false,
NOT(OR(
$User.ProfileId = "00exxxxxx" ,/*System Administrator*/
$Profile.Id = "00exxxxxxxx" ,/*Finance Administration*/
$Profile.Id = "00exxxxxx" ,/*Super User*/
$User.Alias = 'ccc' ,
$User.Alias = 'vvvv',
$User.UserRoleId = '00Errrrrrr', /*Head of Customer Growth*/
$User.UserRoleId = '00Errrrr' /*Customer Growth Rep*/
))
)
3
  • Are you closing the the opportunity and marking close date in same transaction ? I can think of only this scenario where date will not change
    – Elijah
    Jan 24, 2022 at 9:50
  • Thank you for the quick response elijah, There are two validation rules to close the opportunity in place. The close date in future remains the same meaning validation rule do not set the date to future or the current date. Is it what you meant elijah?
    – tough
    Jan 24, 2022 at 10:05
  • 1
    Validation rules does NOT change any value in salesforce. It only prompts an error message if the criteria you put is met. Also avoid hardcoding ids because when you deploy from sandbox to production the id value may change. Use $Profile.Name <> "System Administrator" instead. To auto-update Close Date, why don't you use Flow or Apex to update Close Date to Today's date when Stage = Closed Won?
    – compski
    Jan 24, 2022 at 10:35

1 Answer 1

1

Its default behaviour of sandbox it cant be activated or deactivated and certainly validation rules can't be impacting this.

One of the reasons for Opportunity close date to not default back to today's date when you mark the Opportunity as "Closed Won" could be

Marking/Changing the close date in same edit as marking the Opportunity record as Closed Won, in this case close date is not defaulted back rather kept same as entered during record update.

To update these opportunities simply create a flow to update the opportunities with today's date.

Criteria - IsWon = true Update - CloseDate to {!$Flow.CurrentDate}

Reference article - https://help.salesforce.com/s/articleView?id=000323585&type=1

Note : As good practice dont hard code anything in your validation rules.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .