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
Taha Khan 7Taha Khan 7 

change validation rule on Opportunity to trigger using custom settings.

Hi All,
I am very new to development and aI have to change one validation rule into trigger using custom settings.
For example:Validation rule on an opportunity has some profiles, some roles and stage 
something like below-
AND(
ISPICKVAL(StageName ,"Pending"), 
ISPICKVAL(StageName ,"Closed") , 
NOT($Permission.Bypass_Rule_Exclusion), 
$Profile.Name <> " Contractor", 
$UserRole.Name <> "Analyst")

and I need to change this validation rule into trigger.
I can move this hardcoded values to custom settings,but I am not sure how to write a trigger .
Could someone please help me.
All help is highly appreciated