project BLF > class BWorkObject > method GetRoleScopeFields

Description

Get a list of valid role scope fields


Parameters


icRoleDescriptioninputcharacterRole
icBusinessComponentinputcharacterBusiness Component
ocRoleScopeFieldsoutputcharacterRoleScopeFields
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bworkobject.p)

if icRoleDescription = ""
or icRoleDescription = ?
or icBusinessComponent = ""
or icBusinessComponent = ?
then return.

<Q-1 run RoleByNameActiveDescr (all) (Read) (NoCache)
          (input icRoleDescription, (RoleDescription)
           input true, (RoleIsActive)
           input ?, (RoleName)
           output dataset tqRoleByNameActiveDescr) in BRole >
find first tqRoleByNameActiveDescr no-error.
if not available tqRoleByNameActiveDescr
then return.

if tqRoleByNameActiveDescr.tcBusComponentCode = ""
then return.

if search ("appinfo/":U + lc(icBusinessComponent) + "_bf.r":U) <> ?
or search ("appinfo/":U + lc(icBusinessComponent) + "_bf.p":U) <> ?
then do:
    empty temp-table tBusinessFields.

    run value ("appinfo/":U + lc(icBusinessComponent) + "_bf.p":U) (input table tBusinessFields by-reference, input vhFcSuper, output viFcReturnSuper).

    for each tBusinessFields where
             tBusinessFields.tcRelatedObject = tqRoleByNameActiveDescr.tcBusComponentCode :
        assign ocRoleScopeFields = ocRoleScopeFields
                                 + (if ocRoleScopeFields = "" then "" else ",":U)
                                 + tBusinessFields.tcFcFieldName.
    end.

    /* clean-up */
    empty temp-table tBusinessFields.
end.