project QadFinancials > class BConsolid > method DefaultValuesSourceLayer

Description

Default Values: Retrieves all the Layers based on Source Layer Type. Used on UI to know which layers to show when the target layer type was changed.


Parameters


icSourceLayerTypeinputcharacterSource Layer Type
tConsolidLayerDefaultoutputtemp-tableDefault Consolidation Layers
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program6/bconsolid.p)

/* ========================= */
/* Set default return Status */
/* ========================= */
assign viLocalReturnStatus = oiReturnStatus
       oiReturnStatus      = -98
       viCnt               = 0.

empty temp-table tConsolidLayerDefault.

/* ============================================== */
/* Retrieve all layers for the selected layertype */
/* ============================================== */
<Q-1 run LayerByCodeTypeCode (all) (Read) (NoCache)
   (input icSourceLayerType, (LayerTypeCode)
    input '':U, (LayerCode)
    output dataset tqLayerByCodeTypeCode) in BLayer >
for each tqLayerByCodeTypeCode where
         tqLayerByCodeTypeCode.tcLayerTypeCode = icSourceLayerType:
    
    create tConsolidLayerDefault.
        
    assign viCnt                                           = viCnt + 1
           tConsolidLayerDefault.tcLayerCode               = tqLayerByCodeTypeCode.tcLayerCode
           tConsolidLayerDefault.Layer_ID                  = tqLayerByCodeTypeCode.tiLayer_ID
           tConsolidLayerDefault.tc_Rowid                  = string(viCnt)
           tConsolidLayerDefault.tlConsolidLayerIsSelected = true.
end. /* for each tqLayerByCodeTypeCode */

assign oiReturnStatus = viLocalReturnStatus.