What does this variable mean? $L.approval.intersect

Hi experts, I have to know, what does these below line does. $L.approval.intersect, app.control in $L.phase, approvals in $L.env what kind of values these variable will be holding? when i checked in RAD Debugger. I got the values. but i have to know the exact meaning of that variable. evaluate(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 Regards, Shalini R
  • I found this in the approval.init RAD app:

    $L.void=rtecall("intersect", $L.err, $L.approval.intersect, $L.groups, current.pending.groups in $L.approval future.groups in $L.approval)

    This probably looks to see if you belong to an approval group that is either listed as a current pending group or a future group that will need to approval.  If it finds something, $L.approval.intersect will list out those approval groups.

  • Verified Answer

    $L.approval.intersect is a variable generated within the 'approval.init' RAD application on panel 'check.can.approve'

    The short answer is, this variable is an array that lists out all the users and groups this particular user can approve for.

    The long answer -
    In this line of code on the 'check.can.approve' panel of the 'approval.init' RAD application 

    $L.void=rtecall("intersect", $L.err, $L.approval.intersect, $L.groups, current.pending.groups in $L.approval future.groups in $L.approval)

    There is an rtecall 'intersect' used to compare the contents of two arrays and return an array containing all the values they have in common.  The rtecall is not documented, but it's basically:

    $L.void=rtecall($L.fnc.name, $L.errorcode, $L.returnArray, $L.arrayOne, $L.arrayTwo)
    $L.fnc.name | String | The name of the function to call (in this case, "intersect")
    $L.errorcode | Number | The number of the error code encountered (if any)
    $L.returnArray | Array | An array containing all the elements that are in both $L.arrayOne and $L.arrayTwo
    $L.arrayOne | Array | An array of values you wish to compare
    $L.arrayTwo | Array | A second array of values you wish to compare

    $L.void=rtecall("intersect", $L.err, $L.returnArray, {"Pete", "Joe", "Paul", "Steve"}, {"Mike", "Joe", "Ethan", "Pete"})
    After running, the value of $L.returnArray = {"Pete", "Joe} because those elements appear in both input arrays.

    In the case of the Approval record, the $L.groups array is generated by other code in that approval.init RAD application and is basically a list of all the people and groups (in total, including delegates) that this particular operator COULD approve for, and then the system compares that array to the current and future approvers within THIS SPECIFIC Approval record, and returns an array of values if there are any matching values between those two arrays.