project QadFinancials > class BBox1099 > method CreateBox1099

Description

Initialize a new record in class table tBox1099.


Parameters


ic_ParentRowidinputcharacter= tBox1099.tc_ParentRowid
BBox1099outputdatasetclass dataset, containing only the newly initialized record
oiReturnStatusoutputintegererror status


program code (program/bbox1099.p)

    assign oiReturnStatus = -98.

    empty temp-table t_sBox1099.
    empty temp-table t_sBox1099PurchaseTypeLink.
    empty temp-table t_sTransString.
    empty temp-table t_sCustomTable0.
    empty temp-table t_sCustomTable1.
    empty temp-table t_sCustomTable2.
    create tBox1099.
    assign tBox1099.tc_Rowid  = dynamic-function("GetNumberForNew":U in {&TARGETPROCEDURE})
           tBox1099.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 tBox1099.Box1099_ID = dynamic-function ("GetNextValue":U in vh_persistence,"ObjectNumber":U).
    { includes/bfcrun.i
      &procedure  = "InitialValues"
      &parameters = "input 'Box1099':U,
                     output oiReturnStatus" }

    create t_sBox1099.
    raw-transfer tBox1099 to t_sBox1099.