project QadFinancials > class BEmployee > method ApiLoadEmployeeCalcCostCentreCode

function returns character

Description

This method is used to load cost centre code by CostCentre_id.


Parameters


iiCostCentreIdinputintegerCost Centre ID.


Internal usage


QadFinancials
method BEmployee.ApiLoadEmployee


program code (program9/bemployee.p)

define variable oiReturnStatus as integer no-undo.

if iiCostCentreId = ? or
   iiCostCentreId = 0
then return "":U.

<Q-1 run CostCentrePrim (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input iiCostCentreId, (CostCentreID)
    input ?, (CostCentreCode)
    output dataset tqCostCentrePrim) in BCostCentre >

find first tqCostCentrePrim where
           tqCostCentrePrim.tiCostCentre_ID = iiCostCentreId
           no-error.

return if available tqCostCentrePrim
       then tqCostCentrePrim.tcCostCentreCode
       else "":U.