project QadFinancials > class BBankEntry > method InitInstance

Description

This method can be extended with code to execute when an instance of a business class is started.

PreCondition

This method is executed when a new instance of the business class is started, or when a draft instance is opened (in that case a new instance is started which is a copy of the draft instance).


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program/bbankentry.p)

<ANCESTOR-CODE>


    /* necesarry to check the validatebcandadditionalupdates     */
    /* it must only be executed when instance is started here to */
    /* if you are changing a draft, don't set it on false, it will be automatically set correctly   */
    if not vlDraftsActive
    then assign vlBCDocumentIsStartedFromBE   = false
                vlBCInvoiceIsStartedFromBE    = false
                vlBDDocumentIsStartedFromBE   = false
                vlBDInvoiceIsStartedFromBE    = false
                vlBJEIsStartedFromBE          = false.

    /* Read Company variables only once */
    <Q-1 run CompanyPrim (all) (Read) (NoCache)
          (input viCompanyId, (LookupCompanyId)
           input ?, (CompanyCode)
           output dataset tqCompanyPrim) in BCompany >
    find first tqCompanyPrim no-error.
    assign vcCompanyCodeBE = if available tqCompanyPrim
                             then tqCompanyPrim.tcCompanyCode
                             else "":U.