Opportunity – Fixing CloseDate Not Changing to Today When Closing Opportunity

closedateopportunityvalidation-rule

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*/
))
)

Best Answer

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.

Related Topic