project QadFinancials > class BPaymentSelection > method CreatePaySel

Description

Initialize a new record in class table tPaySel.


Parameters


ic_ParentRowidinputcharacter= tPaySel.tc_ParentRowid
BPaymentSelectionoutputdatasetclass dataset, containing only the newly initialized record
oiReturnStatusoutputintegererror status


program code (program/bpaymentselection.p)

    assign oiReturnStatus = -98.

    empty temp-table t_sPaySel.
    empty temp-table t_sPaySelHistory.
    empty temp-table t_sPaySelLine.
    empty temp-table t_sPaySelLineStage.
    empty temp-table t_sPaySelPayCode.
    empty temp-table t_sCustomTable0.
    empty temp-table t_sCustomTable1.
    empty temp-table t_sCustomTable2.
    create tPaySel.
    assign tPaySel.tc_Rowid  = dynamic-function("GetNumberForNew":U in {&TARGETPROCEDURE})
           tPaySel.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 tPaySel.PaySel_ID = dynamic-function ("GetNextValue":U in vh_persistence,"ObjectNumber":U).
    { includes/bfcrun.i
      &procedure  = "InitialValues"
      &parameters = "input 'PaySel':U,
                     output oiReturnStatus" }

    create t_sPaySel.
    raw-transfer tPaySel to t_sPaySel.