Requester cannot be the Approver

SD_Chandan
Kilo Sage

if you are the requester for one catalog and you are the approver as well and when you are trying to approve your own request then there should be an error message saying that "Requester cannot be the Approver"

Thank you
Chandan
1 ACCEPTED SOLUTION

SN_Learn
Kilo Patron
Kilo Patron

Hi @SD_Chandan ,

 

You can achieve this without any coding.

Create a business rule on [sysapproval_approver] table:

SN_Learn_0-1722875300081.png

 

 

In the action, define as below:

 

SN_Learn_1-1722875373779.png

 

 

Result:

SN_Learn_2-1722875452845.png

SN_Learn_3-1722875510108.png

 

 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

View solution in original post

5 REPLIES 5

SD_Chandan
Kilo Sage

what is the solution we can use client script or workflow or ui policy ? .......
suggest the best suitable way 

 

Thank you
Chandan

Community Alums
Not applicable

Hi @SD_Chandan 

please use following client script of type onchange.

function onSubmit() {

    var requester = g_form.getValue('variables.requester');

    var reqApprover   = g_form.getValue('variables.approver');

    if ( reqApprover.toString() == requester.toString() ){

         g_form.hideFieldMsg('approver', true);

         g_form.showFieldMsg('approver','Approver can not be same as the Requester!','error');

         g_form.setValue('variables.approver','');

         g_form.getControl('variables.approver').focus();  

  return false;

  }

};

 

please mark helpful and accept solution if this will helps solve your requirement.

this is correct but i want to do this for variable requestor_name from catalog and approverfor from sysaproval table

Thank you
Chandan

Hi @SD_Chandan ,

 

You can replace the below provided business rule condition.

Approver is same as Approval for.Requested For(if this field is there on the RITM form)

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.