project QadFinancials > class BBudget > method DataLoadActiveOnly

Description

This mehtod is to load data from the database into the class temp-tables of the business class.
Note: Method DataLoadActiveOnly will - after the standard DataLoad is executed - remove the non-active budgetversions and their underlaying figures from the instance-data. To keep track of this situation, data-item vlActiveVersionOnly is set in this method and in method InitInstance and it is used to check upon in a submethod of ValidateComponent.


Parameters


icRowidsinputcharacterComma seperated list of rowids of records of the main table, converted to string format.
icPkeysinputcharacterList of the values of the primary key fields of records of the main table.
Fields are chr(2) seperated, keys are chr(4) seperated.
Fields are listed in the order as they appear in the primary index. You are not obliged to give a value for all fields of the primary index, but the list cannot contain any 'gaps'.
icObjectIdsinputcharacterComma seperated list of values of the identity field of records of the main table.
icFreeforminputcharacterIn case none of the standard keys (primary, rowid, identity) are available, you can load data based on a freeform for each statement on the main table of the business class.
This for each statement should not contain break by, sorting or no-lock options.
ilKeepPreviousinputlogicalTrue if the data to load must be added to the already existing data in the class temp-tables.
False if the data to load must replace the already existing data.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bbudget.p)

/* ================================================================================================= */
    /* DataLoadActiveOnly; Load data from the database into the class temp-tables of the business class. */
    /* Note: Method DataLoadActiveOnly will - after the standard DataLoad is executed - remove the       */
    /* non-active budgetversions and their underlaying figures from the instance-data. To keep track of  */
    /* this situation, data-item vlActiveVersionOnly is set in this method and in method InitInstance    */
    /* and it is used to check upon in a submethod of ValidateComponent.                                 */
    /* ================================================================================================= */
    /* Method DataLoadActiveOnly will - after the standard DataLoad is executed - remove the non-active budgetversions and their underlaying figures from the instance-data. To keep track of this situation, data-item vlActiveVersionOnly is set in this method and in method InitInstance and it is used to check upon in a submethod of ValidateComponent.     */
    /* ===================== */
    /* default return-status */                                                                            
    /* ===================== */
    assign oiReturnStatus = -98.
    /* =================================== */
    /* Indication of the partial data-load */
    /* =================================== */
    assign vlActiveVersionOnly = true.       
    /* =================================== */
    /* perform standard data-load          */
    /* =================================== */
    <M-1 run DataLoad (input  icRowids (icRowids), 
                   input  icPkeys (icPkeys), 
                   input  icObjectIds (icObjectIds), 
                   input  icFreeform (icFreeform), 
                   input  ilKeepPrevious (ilKeepPrevious), 
                   output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0 then Return.      

    /* =============================================== */
    /* Remove the non-active verions and their figures */
    /* =============================================== */
    
    /*** Made redundant by code in method DataDescription
    
    for each tBudgetVersion where 
             tBudgetVersion.BudgetVersionIsActive = false : 
        for each tBudgetVersionGLFig where 
                 tBudgetVersionGLFig.tc_ParentRowid = tBudgetVersion.tc_Rowid : 
            delete tBudgetVersionGLFig.
        end. /* for each */                                 
        for each tBudgetVersionFig where 
                 tBudgetVersionFig.tc_ParentRowid = tBudgetVersion.tc_Rowid : 
            delete tBudgetVersionFig.
        end. /* for each */
        delete tBudgetVersion.
    end. /* for each tBudgetVersion */ 
    
    
    ***/


    /* =============================================== */            
    /* Set return-status = OK                          */
    /* =============================================== */
    if oiReturnStatus = -98
    then assign oiReturnStatus = 0.