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
uzairuzair 

Having problem in approval process.

Hi all,

 

I had created an approval process, to automate the submission I wrote a trigger.

 

I used the below Condition to Exclude profiles from entering the approval process.

 

 

if(trigger.new[i].stageName != 'Closed Won' && oldOpp.stageName == 'Closed Won' && (UserInfo.getProfileId() !='00e200000019jtu' && UserInfo.getProfileId() !='00e20000000seRt' ))

 

The records are getting locked for all the Profiles, even for the excluded profiles.This should not be the Case.

 

In the approval process I used the criteria as:

Opportunity: Stage not equal to Closed Won

Any help to over this issue come will be appreciated.

Thanks in Advance.