project BLF > class Database Component > method DataSave

Description

Write the data of current instance to the database.

PreCondition

The data must be available on the server instance and validated.
If the instance was added to a transaction, method DataSave will do nothing.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method database.apiDeleteInstance
method database.ApiForcePublish
method database.MaintainByDatasetWithOutput
method BBaseDaemon.ApiSynchronise
method BBaseDaemon.ApiValidateStatus
method BBaseDaemon.ControlDaemon
method BBaseDaemonQueue.ApiResetDaemonQueueStatus
method BBaseDaemonQueue.LockWorkItem
method BBaseDaemonQueue.SetWorkResult
method BBusinessComponent.ApiSynchronise
method BBusinessComponent.ApiSynchroniseDefaultActivities
method BBusinessComponent.CreateComponent
method BCompany.ApiSynchronise
method BCompany.SynchronizeSharedSet
method BControlProperty.ApiSaveViewSettings
method BControlProperty.RemoveCustomFieldFromUI
method BControlProperty.SaveControlProperties
method BCorrLog.ConfirmReported
method BCorrLog.CreateCorruption
method BDocumentLink.ApiDumpDocuments
method BDocumentLink.SaveDocumentList
method BDocumentLink.StoreDocument
method BDomain.SetDomainTypeAsSystem
method BDomain.SetPrimaryCompany
method BDomain.SynchronizeSharedSet
method BDraftInstance.apiDeleteDraftByTransactionID
method BEventDaemon.ApiUpdate
method BFcSession.CreateFcSessionRecord
method BFcSession.DeleteFcSessionRecord
method BFcSession.UpdateFcSessionRecord
method BFcTranslation.LoadResourceFile
method BLanguage.ApiSynchronise
method BNumber.ActivateSequence
method BNumber.ApiPrepareReleasedNumbers
method BNumber.ApiSetFreeNumbers
method BNumber.DeActivateSequence
method BObjectSecurity.DataSaveObjectSecurity
method BPrinter.apiRefreshInfo
method BQueryCache.ApiDeleteQuery
method BQueryCache.RunQuery
method BReportDaemon.UpdateSocketInformation
method BReportTranslation.apiSynchronise
method BReportVariant.SetReportCBF
method BResource.ApiLinkResource
method BResource.ApiSetResourceCategories
method BResource.ApiSynchronize
method BResource.CreateResource
method BRole.ApiSynchronise
method BRole.CreateRolResource
method BRole.SaveRolePermissionsData
method BScanDaemon.ApiUpdateDaemonConfiguration
method BScanDaemonQueue.CreateScanDaemonQueue
method BSetting.ApiUpdateSetting
method BSetting.CreateSystemSettings
method BSettingConfiguration.apiSynchronise
method BSharedSet.ApiSynchronise
method BSharedSetType.ApiSynchronise
method BSODCategory.ApiCreateCategories
method BSODCategoryExclusion.ApiSetMatrixData
method BSODLog.ApiArchive
method BSODViolationRule1.CheckRule1
method BSODViolationRule1.DeleteFinish
method BSODViolationRule2.CheckRule2
method BSODViolationRule2.DeleteFinish
method BStoredSearch.apiSaveStoredSearch
method BStoredSearch.ApiSetStoredSearchDeletion
method BSystem.ActivateSOD
method BTimeOutDaemonQueue.CreateTimeOutDaemonQueue
method BTranslation.ApiSetTranslation
method BUser.ApiSaveUserDomainEntityAccess
method BUser.ApiSynchronise
method BUser.LinkCompanyToDaemonUsers
method BUserRole.ApiSaveUserMembership
method BUserRole.ApiSynchronise
method BUserRole.UpdateUsrRoleFromUserMnt
method BWorkClass.ApiUpdate
method BWorkObject.CreateDraftWorkObject
method BWorkObject.DeleteWorkObjectScopeHolders
method BWorkObject.UpdateWorkobjectStatus
method BXmlDaemon.ApiSynchronise
method BXmlDaemon.ApiUpdate
method BXmlDaemonQueue.ApiClearQueue
method BXmlDaemonQueue.CreateDaemonQueue
method BRole.ApiMaintainRolesForModuleURI
method BFcTranslation.ApiSaveFcTranslation

QadFinancials
method BAccountingInterface.ApiSynchronise
method BAcctIFFilters.ApiUpdateAcctIFFilter
method BAddressType.ApiStdMaintainTT
method BAddressType.ApiSynchronise
method BAllocationBatch.ExecuteAllocationBatch
method BBalanceDaemonQueue.CreateBalanceDaemonQueue
method BBankAccountFormat.ApiSynchronise
method BBankEntry.ApiCreateBankEntryFromImport
method BBankEntry.ApiStdMaintainTT
method BBankFileFormat.ApiMaintainStdTT
method BBankImport.ApiEDIImportBankImport
method BBankImport.ApiImportUSBank
method BBankImportLine.ApiProcessBankImpLineNewBankEntry
method BBankNumber.ApiStdMaintainTT
method BBankPayFormat.ApiMaintainStdTT
method BBankPayFormat.UpdateBankPayFormatNbr
method BBill.ChangeBillStatus
method BBill.ConfirmPrint
method BBill.CreateBills
method BBLWICountry.ApiStdMaintainTT
method BBudget.ApiCopyBudget
method BBudgetDaemonQueue.CreateBudgetDaemonQueue
method BBudgetLink.ApiCreateOrUpdateBudgetLink
method BBudgetLink.DeleteBudgetLinkByBudgetID
method BBudgetLinkAcc.ApiCreateOrUpdateBudgetLinkAcc
method BBudgetLinkAcc.DeleteBudgetLinkAccByBudgetID
method BBudgetLinkAccDet.ApiCreateOrUpdateBudgetLinkAccDet
method BBudgetLinkAccDet.DeleteBudgetLinkAccDetByBudgetID
method BBudgetLinkActual.ApiCreateBudgetLinkActual
method BBudgetLinkActual.ApiUpdateBudgetLinkActualRep
method BBudgetLinkActual.DeleteBudgetLinkActualByBudgetID
method BBudgetLinkCommitment.ApiCreateBudgetLinkCommit
method BBudgetLinkCommitment.DeleteBudgetLinkCommitByBudgetID
method BBusinessRelation.ApiMaintainAddressForEI
method BBusinessRelation.ApiStdMaintainTT
method BBusinessRelation.ApiSynchronise
method BBusinessRelation.MaintainAddressMulti
method BCDocument.ApiSetCDocumentStatusChange
method BCDocument.ApiStdMaintainTT
method BCDocument.ApiUpdateCDocumentPrint
method BCDocument.CreateVoidedDocument
method BCDocumentStatus.CreateDocumentStatusForBankGL
method BCInvoice.ApiCreateCreditorInvoices
method BCInvoice.ApiStdMaintainTTWithExtPost
method BCInvoice.ApiStdMaintainTTWithIntPost
method BCInvoice.ApiUpdateCInvoiceFromAPM
method BCompany.ApiStdMaintainTT
method BConCheck.ConCheckExecute
method BConCheck.UpdateConCheckToDate
method BConCheckProcessor.ConCheckCreateBatchRequest
method BConsolid.CreateConsolidation
method BConsolidPeriodXref.ApiSetConsolidPeriods
method BCostCentre.ApiStdMaintainTT
method BCountry.ApiStdMaintainTT
method BCountry.ApiSynchronise
method BCounty.ApiStdMaintainTT
method BCPay.ApiCreateCPay
method BCPay.ApiCreateCPayRecords
method BCreditor.ApiStdMaintainTTV01
method BCreditorBalance.RebuildHistory
method BCreditorReport.CreditorWHTCertificate
method BCrossCyDaemonQueue.CreateCrossCyDaemonQueue
method BCubeDaemonQueue.CreateFRWCubeDaemonQueue
method BCurrency.ApiStdMaintainTT
method BCurrency.ApiSynchronise
method BDDocument.ApiSetDDocumentStatusChange
method BDDocument.ApiStdMaintainTT
method BDebtor.ApiCheckCreditLimit
method BDebtor.ApiStdMaintainTT
method BDebtor.ApiUpdateDebtorHighCreditInfo
method BDebtor.ApiUpdateDebtorPaymentSales
method BDebtorBalance.RebuildHistory
method BDebtorEndUser.ApiCreateDebtorEndUser
method BDebtorEndUser.ApiDeleteEndUserForDebtor
method BDebtorEndUser.ApiStdMaintainTT
method BDebtorShipTo.ApiCreateDebtorShipto
method BDebtorShipTo.ApiDeleteShiptoForDebtor
method BDebtorShipTo.ApiMaintainDebtorShipto
method BDInvoice.ApiCreateDebtorInvoicesV01
method BDInvoice.ApiCreateDInvoicesFinCharge
method BDInvoice.ApiSetDeductionStatus
method BDInvoice.ApiStdMaintainTTWithExtPost
method BDInvoice.ApiStdMaintainTTWithIntPost
method BDInvoice.ApiUpdateCInvoiceWithNewBank
method BDInvoice.ApiUpdateDInvoiceOpInfo
method BDInvoice.UpdateDeductionDetail
method BDInvoice.UpdateDeductionForBouncedDDoc
method BDInvoice.UpdateDInvoiceDeductionStatus
method BDInvoice.UpdateDInvoiceReminderCount
method BDInvoice.UpdateDInvoiceReminderCountV01
method BDivision.ApiStdMaintainTT
method BDomain.ApiSynchronise
method BDPay.ApiCreateDPay
method BDPay.ApiCreateDPayRecords
method BDPaymentSelection.DeleteDPaySelLine
method BExchangeRate.ApiSaveDerivedExchangeRates
method BExchangeRate.ApiStdMaintainTT
method BExchangeRateType.ApiSynchronise
method BExpenseGLMatrix.ApiSetExpenseGLMatrix
method BFixedAssetAsset.ApiStdMaintainTT
method BFixedAssetCapital.ApiCreateFACapital
method BFixedAssetCapital.ApiStdMaintainStatus
method BFRWAnalysisCode.AdditionalUpdatesReportTree
method BFRWAnalysisCode.UpdateFRWAnCode
method BGL.ApiStdMaintainTT
method BGLMask.ApiGetGLMasks
method BGLMask.ApiSetGLMasks
method BGLMask.ApiStdMaintainTT
method BGLOpenItem.ValidateBCAddUpdDataSave
method BGLSystemType.ApiSynchronise
method BGLSystemType.SynchronizeGLSystemType
method BGLType.ApiSynchronise
method BHistoryDaemonQueue.CreateHistoryDaemonQueue
method BHoliday.UpdateHolidayByInput
method BJournal.ApiGenerateInitialJournals
method BJournal.ApiStdMaintainTT
method BPosting.ApiMassDeletePeriodicCostingPostings
method BPosting.ApiMassDeletePeriodicCostingPostingsByDomain
method BPosting.ApiMassReversePeriodicCostingPostings
method BPosting.ApiMassReversePeriodicCostingPostingsByDomain
method BPosting.ApiStdMaintainMultiTT
method BPosting.ApiStdMaintainTT
method BPosting.UpdateCrossCompanyIDs
method BJournalEntry.ApiUpdateJournal
method BJournalEntry.CreateRecEntryPosting
method BJournalEntry.ValidateBCAddUpdDataSave
method BJournalType.ApiSynchronise
method BLayer.ApiGenerateInitialLayers
method BLayer.ApiStdMaintainTT
method MfgDatabaseComponent.ProcessMaintainDataSave
method BMfgAccount.ApiReplicateFromFinancials
method BMfgAccount.DeleteRoleFromCanRun
method BMfgAcctSubCCProj.ApiReplicateFromFinancials
method BMfgAddress.ApiReplicateFromFinancialsBusRel
method BMfgAddress.ApiReplicateFromFinancialsCreditor
method BMfgAddress.ApiReplicateFromFinancialsDebtor
method BMfgAddress.ApiReplicateFromFinancialsEndUSer
method BMfgAddress.ApiReplicateFromFinancialsShipTo
method BMfgAddress.DeleteDockAddressesForCustomer
method BMfgAddressListDetail.ApiReplicateFromFinancialsCreditor
method BMfgAddressListDetail.ApiReplicateFromFinancialsDebtor
method BMfgAddressListDetail.ApiReplicateFromFinancialsEndUser
method BMfgAddressListDetail.ApiReplicateFromFinancialsShipTo
method BMfgControlWorkTable.DeleteRoleFromCanRun
method BMfgCostCenter.ApiReplicateFromFinancials
method BMfgCreditTerms.ApiReplicateFromFinancials
method BMfgCustomer.ApiReplicateFromFinancials
method BMfgCustomer.UpdateCustomerLanguageSearchName
method BMfgDataEntryProfile.DeleteRoleFromCanRun
method BMfgDaybook.ApiReplicateFromFinancials
method BMfgEmployee.ApiReplicateFromFinancials
method BMfgEndUser.ApiReplicateFromFinancials
method BMfgEndUser.MaintainDataBusinessRelation
method BMfgEntity.ApiReplicateFromFinancials
method BMfgExchangeRate.ApiReplicateFromFinancials
method BMfgInventoryMovSite.DeleteRoleFromCanRun
method BMfgMenu.DeleteMenuFromResource
method BMfgNRM.ApiReplicateFromFinancials
method BMfgPendingVoucher.ApiUpdatePendingVoucherFromERS
method BMfgProject.ApiReplicateFromFinancials
method BMfgSite.DeleteRoleFromCanRun
method BMfgSubAccount.ApiReplicateFromFinancials
method BMfgSupplier.ApiReplicateFromFinancials
method BMfgSupplier.UpdateSupplierLanguageSearchName
method BMfgSystemAccountControl.UpdateRndMthd
method BPaymentCondition.ApiStdMaintainTT
method BPaymentFormat.ApiImportPaymentFormat
method BPaymentFormat.ApiStdMaintainTT
method BPaymentFormat.ApiSynchronise
method BPaymentSelection.ApiRepetitiveTransferPayments
method BPaymentSelection.APITransferPayments
method BPaymentSelection.ChangeStatusPaymentSelection
method BPaymentSelection.ChangeStatusPaymentSelInBatch
method BPeriod.ApiActivatePeriodForPeriodicCosting
method BPeriod.ApiCreatePeriod
method BPeriod.ApiDeactivatePeriodForPeriodicCosting
method BPeriod.ApiStdMaintainTT
method BPeriod.ApiUpdatePeriodStatus
method BPeriod.LoadAndUpdateInstanceData
method BPeriodMark.CreateDefaultForNewCompany
method BProfile.ApiStdMaintainTT
method BProfile.ApiUpdateProfile
method BProfileType.ApiSynchronise
method BProject.ApiStdMaintainTT
method BProjectGroup.ApiStdMaintainTT
method BProjectStatus.ApiStdMaintainTT
method BQBudgetActual.ApiCreateQBudgetLinkActual
method BQBudgetActual.ApiDeleteQBudgetLinkActual
method BQBudgetCommitment.ApiCreateQBudgetLinkCommit
method BQBudgetCommitment.ApiDeleteQBudgetLinkCommit
method BQCInvoiceMovement.ApiCreateQCInvoiceMovement
method BQCInvoiceMovement.ApiProcessQCInvoiceMovement
method BQCrossCyPosting.ApiCreateQCrossCyPosting
method BQCrossCyPosting.ApiProcessQCrossCyPosting
method BQDInvoiceMovement.ApiCreateQDInvoiceMovement
method BQDInvoiceMovement.ApiProcessQDInvoiceMovement
method BQFRWCube.ApiCreateQFRWCubeAndSaf
method BQFRWCube.ApiDeleteQFRWCube
method BQPosting.ApiCreateQPostingLineSaf
method BQPosting.ApiProcessQPostingLineSaf
method BRecurringEntry.ApiPostRecEntryCommit
method BReplicaDaemonQueue.ApiCreateReplicationDaemonQueue
method BRevaluation.LoadAndUpdateInstanceData
method BRevaluation.LoadAndUpdateInstanceDataPost
method BRole.AddGenCodeGroupToRoles
method BRole.ApiCreateCIApproveRole
method BRoundingMethod.ApiSynchronise
method BSaf.ApiStdMaintainTT
method BSafConcept.ApiStdMaintainTT
method BSafConcept.ApiSynchronise
method BSafStructure.ApiStdMaintainTT
method BSafStructureLink.ApiStdMaintainTT
method BSharedSetMergeLog.LogEndMerge
method BState.ApiStdMaintainTT
method BSystem.ApiSetSystemPropertiesExtInvCert
method BSystemProperty.SetSystemProperties
method BSystemProperty.SetSystemPropertiesExtInvCert
method BSystemProperty.SynchronisePropertyInvCert
method BTaxRegister.UpdateTaxRegisterFinalPrint
method BUserRole.CreateUsrRoleFromRoleCIApproveRole
method BVAT.ApiDeleteOfTaxRate
method BVAT.ApiStdMaintainTT
method BVATGroup.ApiStdMaintainTT
method BVATGroup.ApiSynchronise
method BVATPeriod.APIUpdateVATPeriodStatus
method BYearClosing.ApiStdMaintainTT
method BAcctIFFilters.ApiSynchronise
method BAccountingInterface.ApiUpdateAcctIF
method BBankImportLine.UpdateBankImportLineStatusAndLog
method BBudget.UpdateBudgetCompanyFromChart
method BCOACrossRef.UpdateCOACrossRef
method BSharedSetMerge.MergeBeforeMergeGL

QadFitnesse
method BCInvoice.APICInvoiceReverse
method BCompanyProperty.ApiCompanyUpdate
method BCompanyProperty.ApiUpdateARAPTaxDateProperties
method BDPaymentSelection.ApiDPaymentSelectionCreate
method BPaymentSelection.ApiPaymentSelectionCreate
method BBankEntry.ApiBankingEntryCreate


program code (program1/database.p)

/* set context for auditing */
if vcActivityCode = ""
then do:
    do while program-name(viLvl + 1) <> ?:
        viLvl = viLvl + 1.
    end.
    vcContextforAudit = "API|" + vcFcComponentName + "|" + program-name(viLvl).
end.
else vcContextforAudit = "MENU|" + vcFcComponentName + "|" + vcActivityCode.

<M-20 run StartPersistence
   (output vhPLforAudit (ohPersistence), 
    output viFcReturnSuper (oiReturnStatus)) in database>

vhFcComponent = vhPLforAudit.
<M-16 run SetAuditContext
   (input  vcContextforAudit (icAppContext), 
    input  viSessionID (iiSessionId)) in persistence>

if viTransactionId <> 0
then do:
    if vlTransactionActive
    then do:
        <I-7 {bFcOpenInstance
             &CLASS           = "Transaction"}>
        <M-10 run CommitTransaction
           (input  yes (ilStop), 
            input  {&TARGETPROCEDURE} (ihParentInstance), 
            output vcDummy (ocInstances), 
            output oiReturnStatus (oiReturnStatus)) in Transaction>
        if oiReturnStatus < 0
        then do:
            <I-8 {bFcCloseInstance
            &CLASS           = "Transaction"}>
            return.
        end.
        
        <I-9 {bFcCloseAndStopInstance
             &CLASS           = "Transaction"}>
        assign vlTransactionActive = no.
    end.
    
    return.
end.

do transaction on error undo, throw:

    <M-1 run StartPersistence
          (output vhFcComponent (ohPersistence), 
           output viFcReturnSuper (oiReturnStatus)) in database>
    if viFcReturnSuper <> 0
    then oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then return.
    
    <M-2 run InitTransaction  (output viFcReturnSuper (oiReturnStatus)) in persistence>
    if viFcReturnSuper <> 0
    then oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then return.
    
    <M-3 run DataSaveWorker  (output viFcReturnSuper (oiReturnStatus)) in database>
    if viFcReturnSuper <> 0
    then oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then do:
        assign vhFcComponent = vhFcPersistence.
        <M-4 run AbortTransaction  (output viFcReturnSuper (oiReturnStatus)) in persistence>
        undo, return.
    end.
    
    assign vhFcComponent = vhFcPersistence.
    <M-5 run CommitTransaction  (output viFcReturnSuper (oiReturnStatus)) in persistence>
    if viFcReturnSuper <> 0
    then oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0
    then do:
        undo, return.
    end.
end.

<M-6 run UpdateStatus (output viFcReturnSuper (oiReturnStatus)) in database>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.

finally:
    if vhPLforAudit <> ?
    then do:
        vhFcComponent = vhPLforAudit.
        <M-21 run ClearAuditContext  () in persistence>
    end.
end finally.