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
Scott VeniotScott Veniot 

Trigger Needed! - Update 'Close Date' Field

Hi there,

First time post here, I am hoping to find a solution to my problem from one of you talented developers! I recently implemented an opportunity validation rule which requires users to update the 'close date' field anytime the opportunity 'stage' is set to either Awarded/WIP/Lost/Cancelled, this is all that I want to happen. However, users are recieving the 'update close date' error message anytime they update any field while the 'stage' is set to Awarded/WIP/Lost/Cancelled (due to the limitations of the validation rule). I have tried to resolve this issue with Premier Success to no avail, they suggested that this issue can only be resolved via code development. Which brings me here.

Has anyone encountered this before, I appreciate any feedback.

Cheers,

Scott 

CharlesOliveriaCharlesOliveria
The issue is in the validation rule.  You should post the validation rule so someone can help you with the answer.

It may be that you are only checking if the stage equals one of the stages.  It should also check to see if the sales stage has changed.  ISCHANGED(Stage).
Scott VeniotScott Veniot
Here is the validation rule in it's current form:

Rule Name Update_Close_Date Active Checked

Error Condition Formula AND(OR(ISPICKVAL( StageName ,'WIP'),
ISPICKVAL( StageName ,'Awarded - w/ term & contract'),
ISPICKVAL( StageName ,'Awarded - w/o term & contract'),
ISPICKVAL( StageName ,'Lost'),
ISPICKVAL( StageName ,'Cancelled')),
NOT(ISCHANGED( CloseDate )))

Error Message Update 'Close Date' to reflect contract SIGNED, CANCELLED, or LOST date. Error Location Top of Page

Description Requires user to update close date to accurate date upon award/loss
Scott VeniotScott Veniot
Hi there,

Any update on this? Can you see any issues with the existing validation rule?
Blessy Voola 4Blessy Voola 4
Hi Scott,

Could you try this and let me know if it doesnt work.

if(AND(ISCHANGED(StageName),AND(OR(ISPICKVAL( StageName ,'WIP'),
ISPICKVAL( StageName ,'Awarded - w/ term & contract'),
ISPICKVAL( StageName ,'Awarded - w/o term & contract'),
ISPICKVAL( StageName ,'Lost'),
ISPICKVAL( StageName ,'Cancelled')),
NOT(ISCHANGED( CloseDate )))),true,false)


Thanks!