If requested by is member of Assignment group then restrict his/her approval.

suha2
Tera Contributor

Hi,

Approval Require in Assess State :-Any 1 member can approve from Assignment Group.

if requested by is member of Assignment group then restrict his/her approval.

In change request table when the state is moved to assess, I want to allow approval for member of the assignment group suppose the request by field user is in that assignment group means they not approval that request .can anyone help me this scenario.

6 REPLIES 6

Prithvi Ramesh1
Mega Sage

Hi,
You should write Befor BR on the sysapproval_approver table.

 

conditions -

state - changes to assess

ss.png

Script:

 

if(gs.getUser().isMemberOf(current.sysapproval.assignment_group))
	{
gs.addErrorMessage('As the requester and a member of the assignment group, you cannot approve this change.');
		current.setAbortAction(true);
	}

Hi,

The request field user is approval their own request means it approval that change request but I want to  restrict his/her approval for their own request .

Here Requested by : Fred luddy  (In related record approval fredy luddy approval their own request means it show approval change request )

 I want to restrict that approval  to approval their own  change request 

 

         

suha2_1-1702617894611.png

 

suha2_0-1702617757408.png

 

Harish KM
Kilo Patron
Kilo Patron

Hi @suha2 you can write a BR before update on sysapproval_approver table to abort the submission if requested for is the approver.

Script:

//login user is requested for

if(gs.getUserID() == current.sysapproval.requested_for)

current.setAbortAction(true);

gs.addInfoMessage('You cannnot approve your own request');

}

Regards
Harish

suha2
Tera Contributor

Hi,

 I can write a BR before update on sysapproval_approver table but 

Here Requested by : Fred luddy  (In related record approval fredy luddy approval their own request means it show approval  the change request )

 I want to restrict that approval  to approval their own  change request 

 

suha2_2-1702631049970.png

 

suha2_3-1702631201753.png