project QadFinancials > class BPeriod > method SetPeriodMarkIDSequence1

Description

This method is used to set viPeridoMarkIDSequence1 and vcPeriodMarkCodeSequence1.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BPeriod.InitialValues


program code (program2/bperiod.p)

/* ========================================================================= */
    /* In case field viPeriodMarkIDSequence1 is not yet assigned then do it here */
    /* ========================================================================= */
    if viPeriodMarkIDSequence1 = 0 or 
       viPeriodMarkIDSequence1 = ?
    then do :
        <Q-1 run PeriodMarkByCompSeqCodeAct (all) (Read) (NoCache)
          (input viCompanyId, (CompanyId)
           input ?, (PeriodMarkId)
           input ?, (PeriodMarkCode)
           input 1, (PeriodMarkSequence)
           input ?, (PeriodMarkIsActive)
           output dataset tqPeriodMarkByCompSeqCodeAct) in BPeriodMark >
        find first tqPeriodMarkByCompSeqCodeAct where 
                   tqPeriodMarkByCompSeqCodeAct.tiCompany_ID         = viCompanyId and 
                   tqPeriodMarkByCompSeqCodeAct.tiPeriodMarkSequence = 1
                   no-lock no-error.
        if available tqPeriodMarkByCompSeqCodeAct
        then assign viPeriodMarkIDSequence1   = tqPeriodMarkByCompSeqCodeAct.tiPeriodMark_ID
                    vcPeriodMarkCodeSequence1 = tqPeriodMarkByCompSeqCodeAct.tcPeriodMarkCode.
    end. /* if viPeriodMarkIDSequence1 = 0 */