project QadFinancials > class BBudget > method CreateBudget

Description

Initialize a new record in class table tBudget.


Parameters


ic_ParentRowidinputcharacter= tBudget.tc_ParentRowid
BBudgetoutputdatasetclass dataset, containing only the newly initialized record
oiReturnStatusoutputintegererror status


program code (program/bbudget.p)

    assign oiReturnStatus = -98.

    empty temp-table t_sBudget.
    empty temp-table t_sBudgetCompany.
    empty temp-table t_sBudgetFDS.
    empty temp-table t_sBudgetPeriod.
    empty temp-table t_sBudgetVersion.
    empty temp-table t_sBudgetVersionFig.
    empty temp-table t_sBudgetVersionGLFig.
    empty temp-table t_sBudgetWBS.
    empty temp-table t_sBudgetWBSBusComponent.
    empty temp-table t_sBudgetWBSRoster.
    empty temp-table t_sTransString.
    empty temp-table t_sCustomTable0.
    empty temp-table t_sCustomTable1.
    empty temp-table t_sCustomTable2.
    create tBudget.
    assign tBudget.tc_Rowid  = dynamic-function("GetNumberForNew":U in {&TARGETPROCEDURE})
           tBudget.tc_Status = "N":U.
    { includes/bfcrun.i
      &procedure  = "StartPersistence"
      &parameters = "output vh_persistence,
                     output viFcReturnSuper" }
    if viFcReturnSuper <> 0
    then do:
        assign oiReturnStatus = viFcReturnSuper.
        return.
    end.
    assign tBudget.Budget_ID = dynamic-function ("GetNextValue":U in vh_persistence,"ObjectNumber":U).
    { includes/bfcrun.i
      &procedure  = "InitialValues"
      &parameters = "input 'Budget':U,
                     output oiReturnStatus" }

    create t_sBudget.
    raw-transfer tBudget to t_sBudget.