project QadFinancials > class BFRWAnalysisCode > method GetEntityForSharedSet

Description

This procedure retrieves any entity, that uses certain Shared Set


Parameters


iiGLSharedSet_IDinputinteger
oiGLSSCompany_IDoutputinteger
iiDivisionSharedSet_IDinputinteger
oiDivisionSSCompany_IDoutputinteger
iiCostCentreSharedSet_IDinputinteger
oiCostCentreSSCompany_IDoutputinteger
iiProjectSharedSet_IDinputinteger
oiProjectCompany_IDoutputinteger
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BFRWAnalysisCode.ValidateComponentPreFRWAnCode


program code (program1/bfrwanalysiscode.p)

./* ========================================================================================= *
 * Method:    GetEntityForSharedSet                                                          *
 * Desc:      This procedure retrieves any entity, that uses certain Shared Set              *
 * ----------------------------------------------------------------------------------------- *
 * Params:    (I) GLSharedSet_ID                                                             *
 *            (O) GLSSCompany_ID                                                             *
 *            (I) DivisionSharedSet_ID                                                       *
 *            (O) DivisionSSCompany_ID                                                       *
 *            (I) CostCentreSharedSet_ID                                                     *
 *            (O) CostCentreSSCompany_ID                                                     *
 *            (I) ProjectSharedSet_ID                                                        *
 *            (O) ProjectCompany_ID                                                          *
 * ========================================================================================= */

assign oiGLSSCompany_ID         = ?
       oiDivisionSSCompany_ID   = ?
       oiCostCentreSSCompany_ID = ?
       oiProjectCompany_ID      = ?.

if iiGLSharedSet_ID <> 0 and
   iiGLSharedSet_ID <> ?
then do:
    <Q-10 run CompanySharedSetBySharedSet (all) (Read) (NoCache)
       (input iiGLSharedSet_ID, (SharedSetId)
        input ?, (CompanyId)
        output dataset tqCompanySharedSetBySharedSet) in BCompany>
    find first tqCompanySharedSetBySharedSet where
               tqCompanySharedSetBySharedSet.tiSharedSet_ID = iiGLSharedSet_ID
               no-error.
    if available tqCompanySharedSetBySharedSet
    then assign oiGLSSCompany_ID = tqCompanySharedSetBySharedSet.tiCompany_ID.
end.

if iiDivisionSharedSet_ID <> 0 and
   iiDivisionSharedSet_ID <> ?
then do:
    <Q-83 run CompanySharedSetBySharedSet (all) (Read) (NoCache)
       (input iiDivisionSharedSet_ID, (SharedSetId)
        input ?, (CompanyId)
        output dataset tqCompanySharedSetBySharedSet) in BCompany>
    find first tqCompanySharedSetBySharedSet where
               tqCompanySharedSetBySharedSet.tiSharedSet_ID = iiDivisionSharedSet_ID
               no-error.
    if available tqCompanySharedSetBySharedSet
    then assign oiDivisionSSCompany_ID = tqCompanySharedSetBySharedSet.tiCompany_ID.
end.

if iiCostCentreSharedSet_ID <> 0 and
   iiCostCentreSharedSet_ID <> ?
then do:
    <Q-85 run CompanySharedSetBySharedSet (all) (Read) (NoCache)
       (input iiCostCentreSharedSet_ID, (SharedSetId)
        input ?, (CompanyId)
        output dataset tqCompanySharedSetBySharedSet) in BCompany>
    find first tqCompanySharedSetBySharedSet where
               tqCompanySharedSetBySharedSet.tiSharedSet_ID = iiCostCentreSharedSet_ID
               no-error.
    if available tqCompanySharedSetBySharedSet
    then assign oiCostCentreSSCompany_ID = tqCompanySharedSetBySharedSet.tiCompany_ID.
end.

if iiProjectSharedSet_ID <> 0 and
   iiProjectSharedSet_ID <> ?
then do:
    <Q-62 run CompanySharedSetBySharedSet (all) (Read) (NoCache)
       (input iiProjectSharedSet_ID, (SharedSetId)
        input ?, (CompanyId)
        output dataset tqCompanySharedSetBySharedSet) in BCompany>
    find first tqCompanySharedSetBySharedSet where
               tqCompanySharedSetBySharedSet.tiSharedSet_ID = iiProjectSharedSet_ID
               no-error.
    if available tqCompanySharedSetBySharedSet
    then assign oiProjectCompany_ID = tqCompanySharedSetBySharedSet.tiCompany_ID.
end.