project BLF > class BWorkClass > method Calculate

Description

Add code here to initialize the calculated fields of the class temp-tables after loading existing records from the application database.


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bworkclass.p)

<ANCESTOR-CODE>    
    
    /* ========================================================================================== */
    /* Make sure to fill tWorkClass.tcBusComponentLabel when tWorkClass.BusComponent_ID is filled */
    /* tWorkClass.tcBusComponentLabel is a RelKeyBusField on BusActivity_ID but is used for both  */
    /* ========================================================================================== */
    for each tWorkClass where 
             (tWorkClass.BusComponent_ID <> 0 and tWorkClass.BusComponent_ID <> ?) and 
             (tWorkClass.tcBusComponentCode = "":U or tWorkClass.tcBusComponentCode = ?) :
             
        if vlDataLoadKeepPrevious and can-find (tAlreadyCalculatedRecords where
                 tAlreadyCalculatedRecords.tcTableName = "WorkClass" and
                 tAlreadyCalculatedRecords.tc_Rowid = tWorkClass.tc_Rowid)
        then next.             
             
        <Q-1 run BusComponentPrim (all)  (Read)  (NoCache)  (input tWorkClass.BusComponent_ID, (BusComponentID) 
                           input ?, (BusComponentCode)
                           output dataset tqBusComponentPrim) in BBusinessComponent >
        find first tqBusComponentPrim no-error.
        if available tqBusComponentPrim
        then assign tWorkClass.tcBusComponentCode = tqBusComponentPrim.tcBusComponentCode.
    end. /* for each tWorkClass */