project QadFinancials > class BPeriod > method Calculate

Description

Add code here to initialize the calculated fields of the class temp-tables after loading existing records from the application database.


Parameters


oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bperiod.p)

<ANCESTOR-CODE>

for each tPeriod:

    if vlDataLoadKeepPrevious and 
       can-find (tAlreadyCalculatedRecords where
                 tAlreadyCalculatedRecords.tcTableName = "Period" and
                 tAlreadyCalculatedRecords.tc_Rowid    = tPeriod.tc_Rowid)
    then next.

    <Q-2 run CompanyByDomain (all) (Read) (NoCache)
          (input tPeriod.Company_ID, (CompanyId)
           input '', (DomainId)
           input ?, (Active)
           output dataset tqCompanyByDomain) in BCompany >

    for first tqCompanyByDomain:
        Assign tPeriod.tcDomainCode = tqCompanyByDomain.tcDomainCode
               tPeriod.tcEntityCode = tqCompanyByDomain.tcCompanyCode.
    end.
end.