project QadFinancials > class BFixedAssetAssetType > 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/bfixedassetassettype.p)

<ANCESTOR-CODE>

case icTableName:
    /****************************************/
    /* Initial values for FAAssetType       */
    /****************************************/
    when "FAAssetType":U
    then do:       
        assign tFAAssetType.Company_ID          = viCompanyId
               tFAAssetType.FAAssetTypeIsActive = true.
    end.

    /****************************************/
    /* Initial values for FAAssetTypeFABook */
    /****************************************/
    when "FAAssetTypeFABook":U
    then do:
          /* Lookup the highest sequence number in this instance */
          assign viSequence = 0.
          for each bFAAssetTypeFABook where 
                   bFAAssetTypeFABook.tc_Status <> 'D':U:
              if (bFAAssetTypeFABook.FAAssetTypeBookSequence > viSequence)
              then assign viSequence = bFAAssetTypeFABook.FAAssetTypeBookSequence.
          end.

          assign tFAAssetTypeFABook.FAAssetTypeBookSequence = viSequence + 1
                 tFAAssetTypeFABook.tlFABookIsActive        = true.
    end.
end.