Need to display Approve ,Deny and Retract buttons conditionally

Hi Team ,

I checked the condition for all the 3 display options(Approve,Deny and Retract) and it is same as of respective out of box display options and it is :

evaluate(app.control in $L.phase) and lng(denull(approval.groups in $L.env))>0 and evaluate(approvals in $L.env) and open in $L.filed=true
and (lng($L.approval.intersect)>0 or approve.override in $L.env) and nullsub($G.ess, false)=false

Now if i take example of form " Approval.g " and screen Id "approval.view" there the Display options are working as expected , e.g if one approver has approve the change then he is only able to see " Retract " and like wise for other scenarios. So i checked and found the display option conditon for
"approval.view_approve" is "$L.can.approve"
For "approval.view_deny" is "$L.can.approve"
And for "approval.view_retract" is "$L.can.retract"

Now my question is what this $L.can.approve and $L.can.retract stands for (what values they are holding) , where can i find them ??
Also the main issue is can i use the same variables on my main form " cm.change.approval " and Screen Id " cm.view.display" for the 3 display options(Approve,Deny and Retract) .
And if not then how can i achieve the same funtionality as on form " Approval.g " and screen Id "approval.view" on my main form i.e "cm.change.approval " and Screen Id " cm.view.display" for the 3 display options(Approve,Deny and Retract) .

Regards,
Nikhil

  • Those variables are set in the displayscreen record both for the approval record and for changes/tasks.

     

    The out of box conditions for the application modules  function that way already; if you copy the condition from those to the display options which you added then to the cm.view.display toolbar, it should already work exactly as described.  If you are working wiht a custom displayscreen, you can copy the relevant lines from cm.view.display.

    $L.appr.query="file.name=\"" str(filename($L.filed)) "\" and unique.key=\"" number in $L.filed "\""
    
    $L.delegate.name=jscall("ApprovalUtil.checkDelegate", $L.appr.query, str(filename($L.filed)));$L.ame($L.filed)));$Lapproval.groups=jscall("ApprovalDelegationGroups.addDelegateGroups", approval.groups in $L.env, str(filename($L.filed)))
    
    $L.void=rtecall("intersect", $L.err, $L.approval.intersect, $L.approval.groups, current.pending.groups in $L.filed);$L.void=rtecall("intersect", $L.err, $L.retract.intersect, approval.groups in $L.env, approved.groups in $L.filed)

    The first line just sets up the query used in next line. The second line generates the $L.approval.groups array of groups for which a person may approve, including those for which they have current delegated authority. The third line generates the $L.approval.intersect and $L.retract.intersect that determine "can approve/deny" and "can retract".

     

    Note: any user with Change Override capability will see all three options at all times. 

     

    This is a duplicate of your existing topic. Please close one of them.