project QadFinancials > class BCInvoice > method MaintainByDatasetWithOutput

Description

This method uses contents of the input class temp-tables (prefix t_s) to perform the action specified in icAction. (if icAction is empty, it gets the default value of "SAVE")
SAVE : validate contents and write to database if correct
SAVEDRAFT : validate contents, write to database if correct, copy the data to the class tables (prefix t_o) and create draft instance if incorrect
DRAFT : copy data to the class tables (prefix t_o) and create draft instance
VALIDATE : only validate data

It returns the object dataset if required (if ilProvideOutput = true).

See method ApiStdMaintainTTInitialDefaulting for all further details


Parameters


icActioninputcharacterSAVE
SAVEDRAFT
DRAFT
VALIDATE
ilReturnDatasetinputlogicalIndication whether the logic should return the official dataset of the object that has just been created/modified.
ilPartialUpdateinputlogicalIndication whether the input dataset is a full object or only a partial one.
icPartialUpdateExceptionListinputcharacterComma separated list with fields that need to be skipped in the test logic for partial update.
Fields in the list are specified as t<table>.<field>.
opPrimaryKeyoutputlongchar
opRowidoutputlongchar
oiDraftInstanceoutputinteger
ocPrimaryKeyNameoutputcharacterThe name of the field(s) in the primary key of the object. Normally this is the name of the object ID of the main table. (like creditor_ID)
ozObjectRepresentationoutputdataset-handleThe dataset containing the official representation of the object dataset. It should always be passed by-reference, meaning, the dataset handle should be created before the call.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/bcinvoice.p)

assign oiReturnStatus      = -98
       vlReturnDatasetCI   = ilReturnDataset
       vhDatasetToReturnCI = ozObjectRepresentation
       vcPrimKeyCI         = "".

<M-60 run ApiStdMaintainTTV01
   (input  t_sCInvoice (tApiCInvoice), 
    input  t_sCInvoiceBank (tApiCInvoiceBank), 
    input  t_sCInvoiceBankPayCode (tApiCInvoiceBankPayCode), 
    input  t_sCInvoiceMovement (tApiCInvoiceMovement), 
    input  t_sCInvoicePO (tApiCInvoicePO), 
    input  t_sCInvoicePosting (tApiCInvoicePosting), 
    input  t_sCInvoiceVat (tApiCInvoiceVat), 
    input  t_sCInvoiceStage (tApiCInvoiceStage), 
    input  t_sCInvoiceWHT (tApiCInvoiceWHT), 
    input  icAction (icAction), 
    output opPrimaryKey (ocLstPrimKey), 
    output vcDummy (ocLstReturn), 
    output opRowid (ocLstRowid), 
    output viFcReturnSuper (oiReturnStatus)) in BCInvoice>      

assign ocPrimaryKeyName  = vcPrimKeyCI
       vlReturnDatasetCI = false.

if viFcReturnSuper <> 0
then do: 
    assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0 then return.
end. /* if viFcReturnSuper <> 0 */

if oiReturnStatus = -98 
then assign oiReturnStatus = 0.