project BLF > class Database Component > method BufferCopy

Description

This method can be used to copy data from one temp-table to another. It takes care about the normal fields, but also the temp-table fields (with prefix t<datatype>).
It copies all fields from the current record in the temp-table represented by ihFrom, to the current record in the temp-table represented by ihTo.


Parameters


ihFrominputhandleThe handle to the temp-table from which you want to copy the content.
ihToinputhandleHandle to the temp-table to which you want to copy the content.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method BRole.ApiLoadRoles
method BSODCategory.ApiLoadCategories

QadFinancials
method BAccountingInterface.GetFilter
method BAccountingInterface.GetReportList
method BAltCOAGroup.ApiLoadAltCOAGroup
method BAltCOAStruct.ApiLoadAltCOAStruct
method BBankBranch.ApiLoadBankBranch
method BBankImportLine.GetBankImpLineByFilter
method BBankNumber.ApiLoadCustomerBankNumber
method BBankNumber.ApiLoadSupplierBankNumber
method BBusinessRelation.ApiLoadBusinessRelation
method BBusinessRelation.GetAddressWithID
method BBusinessRelation.GetContactByAddress
method BCInvoice.ApiGetSupplierInvoiceData
method BCOACrossRef.ApiLoadCOACrossRef
method BCOACrossRef.DefaultValuesTypeSeperate
method BCOACrossRef.GetCOACrossRef
method BCOAMaskCC.ApiLoadCOAMaskCC
method BCOAMaskDiv.ApiLoadCOAMaskDiv
method BCOAMaskProj.ApiLoadCOAMaskProj
method BCompany.AdditionalUpdates
method BConsolidCycle.ApiConsolidationCycleList
method BCostCentre.ApiLoadCostCentre
method BCostCentre.ApiLoadCostCentreV01
method BCountry.ApiLoadCountry
method BCounty.ApiLoadCounty
method BCreditor.ApiLoadCreditor
method BCreditor.ApiLoadCreditorV01
method BCreditor.Calculate
method BDCollection.BuildProDataSet
method BDCollection.FillProDataSet
method BDCollection.FillProDataSetCompany
method BDCollection.FillProDataSetDebtor
method BDCollection.FillProDataSetDocument
method BDCollection.FillProDataSetGL
method BDCollection.RetrievePaySelInitial
method BDDocument.ApiLoadDeductionDetail
method BDDocument.ApiLoadDeductionDetailForReview
method BDebtor.ApiLoadDebtor
method BDebtor.Calculate
method BDebtorEndUser.ApiLoadDebtorEndUser
method BDebtorEndUser.ApiStdMaintainTT
method BDebtorEndUser.Calculate
method BDebtorShipTo.ApiLoadDebtorShipTo
method BDebtorShipTo.ApiMaintainDebtorShipto
method BDebtorShipTo.Calculate
method BDeductionCat.ApiLoadDeductionCat
method BDInvoice.ApiGetSalespersonCommissions
method BDInvoice.ApiGetSalespersonPayments
method BDivision.ApiLoadDivision
method BEmployee.ApiLoadEmployee
method BExchangeRate.ApiExchangeRate
method BGL.ApiLoadGL
method BGL.Calculate
method BGL.ValBankNumberRef
method BGrossIncomeAccounting.ApiLoadGrossIncAcc
method BJournal.ApiLoadJournal
method BJournalEntry.GetPostingStatusChange
method BMfgAddress.ApiReplicateFromFinancialsEndUSer
method BMfgAddress.ApiReplicateFromFinancialsShipTo
method BMfgAddress.MapMfgAddressData
method BMfgEndUser.ApiReplicateFromFinancials
method BMirroringGL.ApiLoadMirroringGL
method BMirroringGL.ApiRetrieveMirroringGL
method BMirroringJournal.ApiLoadMirroringJournal
method BPaymentCondition.ApiLoadPaymentCondition
method BPaymentSelection.FillProDataSet
method BPaymentSelection.FillProDataSetCCollection
method BPaymentSelection.FillProDataSetCompany
method BPaymentSelection.FillProDataSetCreditor
method BPaymentSelection.FillProDataSetGL
method BPaymentSelection.FillProDataSetPayment
method BPaymentSelection.FillProdataSetPaymentBankNumber
method BProject.ApiLoadProject
method BSaf.ApiLoadSaf
method BSafConcept.ApiLoadSafConcept
method BSafStructure.ApiLoadSafStructure
method BState.ApiLoadState
method BFRWColumnGroup.ApiLoadFRWColumnGroup
method BFRWReportMaster.ApiLoadFRWReportMaster


program code (program6/database.p)

FromField: DO viCnt1 = ihFrom:NUM-FIELDS to 1 by -1 :

    vhFromField = ihFrom:BUFFER-FIELD(viCnt1).
    
    if can-do ("ti,tg,tl,tc,td,th,tt,te,tr,ta,to,tm,tp",substring(vhFromField:name,1,2,"CHARACTER"))
    then assign vcShortName = substring(vhFromField:name,3,-1,"CHARACTER")
                vcFullName  = vhFromField:name.
    else assign vcShortName = vhFromField:name
                vcFullName  = "t"
                            + entry(lookup(vhFromField:data-type,"integer,int64,logical,character,decimal,handle,date,recid,rowid,raw,com-handle,blob,clob"),"i,g,l,c,d,h,t,e,r,a,o,m,p")
                            + vhFromField:name.
    
    vhToField = ihTo:buffer-field(vcShortName) no-error.
    if valid-handle(vhToField)
    then do:
        vhToField:BUFFER-VALUE = vhFromField:BUFFER-VALUE no-error.
        next FromField.
    end.
    
    vhToField = ihTo:buffer-field(vcFullName) no-error.
    if valid-handle(vhToField)
    then do:
        vhToField:BUFFER-VALUE = vhFromField:BUFFER-VALUE no-error.
        next FromField.
    end.

    vhToField = ?.
    DO viCnt2 = ihTo:NUM-FIELDS to 1 by -1 :
        vhTemp = ihTo:BUFFER-FIELD(viCnt2).
        IF  vhTemp:data-type = vhFromField:data-type
        AND vhTEMP:NAME MATCHES "*" + vcShortName
        THEN IF vhToField = ?
             THEN vhToField = vhTemp.
             ELSE next FromField.   /* do not copy if ambiguous */
    END.
    if vhToField <> ?
    then vhToField:BUFFER-VALUE = vhFromField:BUFFER-VALUE no-error.

END.