project QadFinancials > class Database Component > method MappedBufferCopy

Description

Performs a buffer copy from a source buffer to a target buffer using the specified field mappings to copy the data.


Parameters


ihSourceBufferinputhandleHandle to the source buffer from which the data is going to be copied.
ihTargetBufferinputhandleHandle to the target buffer to which the data is going to be copied.
icBufferFieldMappinginputcharacterComma delimited list of the field mappings between the buffers. It does not matter if the list is in <target-buffer-field>,<source-buffer-field> order or vice versa progress will automatically switch the fields depending on is the target and source buffers.
icExcludeFieldsinputcharacterContains a comma delimited list of the fields that should not be copied by the from the source to the target.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method MfgDatabaseComponent.ProcessMfgData
method BMfgAddress.ApiGetDockAddress
method BMfgAddress.ApiGetHeadOfficeAddress
method BMfgAddress.MapMfgAddressData


program code (program1/database.p)

assign 
    oiReturnStatus = -98.

ihTargetBuffer:buffer-copy(ihSourceBuffer, icExcludeFields, icBufferFieldMapping) no-error.

/*
* Log any errros that occured during the buffer copy processing.
*/
if error-status:error then do:

    do viFcCount1 = 1 to error-status:num-messages:

        <M-1 run SetMessage (input  error-status:get-message(viFcCount1) (icMessage), 
                     input  '' (icArguments), 
                     input  '' (icFieldName), 
                     input  '' (icFieldValue), 
                     input  '' (icType), 
                     input  3 (iiSeverity), 
                     input  string(ihTargetBuffer:rowid) (icRowid), 
                     input  '-1':U (icFcMsgNumber), 
                     input  '' (icFcExplanation), 
                     input  '' (icFcIdentification), 
                     input  'DatabseComponent.MappedBufferCopy()':U (icFcContext), 
                     output viFcReturnSuper (oiReturnStatus)) in database>

    end. /* do viFcCount1 */

    /*
    *  Additional Error handling must be done here ?
    */

    return.
end.

assign 
    oiReturnStatus = 0.