Need: I am trying to write a validation rule that prevents the editing of Closed Opportunities with a Close Date outside of the current calendar month/year, except for certain users. In other words, only 4 specific users should be able to edit a Closed Opportunity if the Close Date is outside of the current calendar month/year.
Problem: I have figured out month piece, but am struggling to get the year part. The validation rule I have written will kind of work. However, if another user changes the Close Date to the same month, but different year, then they can edit the Opportunity.
My current validation rule is below. Does anyone know how to include the current year piece? Thank you so much for taking the time to look.
AND(
PRIORVALUE( IsClosed ) = True,
MONTH(CloseDate)<>MONTH(TODAY()),
NOT(OR(
$User.Alias="aaaaa",
$User.Alias="bbbbb",
$User.Alias="ccccc",
$User.Alias="ddddd" )))