project QadFinancials > class BBankImportLine > method UpdateBankImportLine

Description

This method retrieves a temp-table handle and store the data of the temp-table to database.


Parameters


ihBankImportLinesinputhandlehandle of Bank Import Line
icParentRowidinputcharacterParent Row ID
iiBankImpIDinputintegerBank Import ID
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankImport.ApiEDIImportBankImport
method BBankImport.ApiImportUSBank


program code (program3/bbankimportline.p)

/* ================================================================= */
/*   This method retrieves a temp-table handle and store the data    */
/*   of the temp-table to database                                   */
/* ================================================================= */

assign oiReturnStatus   = -98
       vhBankImpLineBuf = temp-table tBankImpLine:handle:default-buffer-handle.

create query vhQuery in widget-pool "non-persistent".
vhQuery:add-buffer(ihBankImportLines).
vhQuery:query-prepare("for each ":U + ihBankImportLines:table + " by BankImpLineSeq").
vhQuery:query-open().
vhQuery:get-first(no-lock).

/* Go through the temp-table and store records to DB dataset */
repeat while not vhQuery:Query-Off-End:
    <M-5 run AddDetailLine
       (input  'BankImpLine':U (icTable), 
        input  icParentRowid (icParentRowid), 
        output viFcReturnSuper (oiReturnStatus)) in BBankImportLine>

    vhBankImpLineBuf:find-by-rowid(rowid(tBankImpLine)).
    vhBankImpLineBuf:buffer-copy(ihBankImportLines, 'tc_Rowid,tc_Status,BankImpLine_ID,BankImp_ID':U).
    assign tBankImpLine.BankImp_ID = iiBankImpID.

    vhQuery:get-next(no-lock).
end.

if oiReturnStatus = -98 then assign oiReturnStatus = 0.