project QadFinancials > class BJournalGroup > method InitialValues

Description

Add code here to initialize the calculated fields of a 'new' record (= a record that must be created in the application database) in a class temp-table.


Parameters


icTableNameinputcharacterName of the database table of which a record is created in the class temp-table.
oiReturnStatusoutputinteger


Internal usage


unused


program code (program/bjournalgroup.p)

<ANCESTOR-CODE>

if oiReturnStatus < 0
then return.

case icTableName:
    when "JournalGroup":U
    then do:
        assign tJournalGroup.JournalGroupIsActive = true.
        /* =============================================================== */
        /* Set the SharedSet-ID                                            */ 
        /* that is linked to the current company (viCompanyId)             */
        /* =============================================================== */
        assign vcSharedSetTypeJournal = {&SHAREDSETTYPECODE-JOURNAL}.
         <Q-1 run LookupSharedSetForCompany (all) (Read) (NoCache)
            (input viCompanyID, (CompanyId)
             input vcSharedSetTypeJournal, (SharedSetType)
             output dataset tqSharedSetForCompany) in BCompany >      
        find first tqSharedSetForCompany no-error.
        if available tqSharedSetForCompany
        then assign tJournalGroup.SharedSet_ID = tqSharedSetForCompany.tiSharedSet_ID.
    end.
end case.