project BLF > class BUserRole > method DataLoadForForm
Parameters
iiUsrId | input | integer | |
iiRoleId | input | integer | |
ovBUserRole | output | dataset | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program1/buserrole.p)
If oiReturnStatus = 0
Then Assign oiReturnStatus = -98.
If iiUsrId = ? Then Assign iiUsrId = 0.
If iiRoleId = ? Then Assign iiRoleId = 0.
<M-1 run ClearData (output viFcReturnSuper (oiReturnStatus)) in BUserRole>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.
If iiUsrId = 0 And
iiRoleId = 0
Then Return.
Assign vcFreeform = 'For Each UsrRole Where ':U.
If iiUsrId <> 0
Then Assign vcFreeform = vcFreeform + 'UsrRole.Usr_ID = ':U + String(iiUsrId).
If iiUsrId <> 0 And
iiRoleId <> 0
Then Assign vcFreeform = vcFreeform + ' And ':U.
If iiRoleId <> 0
Then Assign vcFreeform = vcFreeform + 'UsrRole.Role_ID = ':U + String(iiRoleId).
<M-2 run DataLoad (input '' (icRowids),
input '' (icPkeys),
input '' (icObjectIds),
input vcFreeform (icFreeform),
input False (ilKeepPrevious),
output viFcReturnSuper (oiReturnStatus)) in BUserRole>
If viFcReturnSuper = -4
Then Do:
/*it is possible that some users are not linked to a role yet*/
Assign oiReturnStatus = 0.
Return.
End.
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then Return.
If oiReturnStatus = -98
Then Assign oiReturnStatus = 0.