project QadFinancials > class BMfgExchangeRate > method MainBlock

Description

MainBlock is run when a component is started. It is not to be confused with InitInstance, which is run when an instance is started. Because of this, it is not possible to use any instance dependent data in this method.

PreCondition

This method is run when r-code for this component or a descendant component is loaded into memory. It is not to be confused with InitInstance, which is run when an instance is started.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program/bmfgexchangerate.p)

<ANCESTOR-CODE>

if not can-find(tMfgBufferFieldMapping where
    tMfgBufferFieldMapping.tcMfgTableName       = "exr_rate":U and
    tMfgBufferFieldMapping.tcFinancialTableName = "ExchangeRate":U) then do:
    create tMfgBufferFieldMapping.
    assign
        tMfgBufferFieldMapping.tcMfgTableName = 'exr_rate':U
        tMfgBufferFieldMapping.tcFinancialTableName = 'ExchangeRate':U
        tMfgBufferFieldMapping.tcFieldMapping = 
            'exr_curr1,tcFromCurrencyCode,':U + 
            'exr_curr2,tcToCurrencyCode,':U +
            'exr_start_date,ExchangeRateValidDateFrom,':U +
            'exr_end_date,ExchangeRateValidDateTill,':U +
            'exr_ratetype,tcExchangeRateTypeCode,':U +
            'tc_status,tc_status':U.
end. /* if(not can-find */