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
Ravi kumar 292Ravi kumar 292 

Trigger On Opportunity to Validate PickList Values

I have Created a custom picklist field on opportunity with items(Stage-1, Stage-2, Stage-3, Stage-4), Included to page layout.

Now my requirement is Write a trigger on Opportunity to validate this Stage value with below conditions,

1. while record updating, Stage can be null/Previous Stage/Same Stage/Next stage(Stage-1 to Stage-2).
2. But stage value should not be skipped to Current Stage + 2 Stages.

Thanks in advance
bob_buzzardbob_buzzard
If you want someone to write the code according to your specification you should post this on the jobs board. If you've had a go yourself and are struggling with the trigger, then post your code and we'll try to help.
A.X. PratapA.X. Pratap
Hint: You can use PRIORVALUE formula and use that in your trigger.