project QadFinancials > class BCountry > 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/bcountry.p)

<ANCESTOR-CODE>

if icTableName = "Country":U
then do:
    assign tCountry.CountryIsActive    = true.

    /* If there is only one BLWICountry, then default it */
/** No longer default BLWICountry to only record found *
    <Q-5 run BLWICountryPrim (Start) in BBLWICountry >

    <Q-6 assign vlFcQueryRecordsAvailable = BLWICountryPrim (Cache)  (input ?, (BLWICountryId) 
                                                         input ?, (BLWICountryCode)) in BBLWICountry >

    if vlFcQueryRecordsAvailable = true
    then do:
        <Q-7 run BLWICountryPrim (all) (Read) (Cache)
          (input ?, (BLWICountryId)
           input ?, (BLWICountryCode)
           output dataset tqBLWICountryPrim) in BBLWICountry >

        find first tqBLWICountryPrim
                   no-error.

        if available tqBLWICountryPrim
        then assign tCountry.BLWICountry_ID    = tqBLWICountryPrim.tiBLWICountry_ID
                    tCountry.tcBLWICountryCode = tqBLWICountryPrim.tcBLWICountryCode.
    end.

    <Q-8 run BLWICountryPrim (Stop) in BBLWICountry >
** No longer default BLWICountry to only record found */
end.

if icTableName = "CountryVatFormat":U
then assign tCountryVatFormat.CountryVatFormat = "":U.