project QadFinancials > class BMfgEmployee > 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/bmfgemployee.p)

<ANCESTOR-CODE>

if not can-find(first tMfgBufferFieldMapping 
                where tMfgBufferFieldMapping.tcMfgTableName = "emp_mstr":U
                     and tMfgBufferFieldMapping.tcFinancialTableName = "MfgEmployee":U)
then do:
    create tMfgBufferFieldMapping.
    assign
        tMfgBufferFieldMapping.tcMfgTableName = 'emp_mstr':U
        tMfgBufferFieldMapping.tcFinancialTableName = 'MfgEmployee':U
        tMfgBufferFieldMapping.tcFieldMapping = 
            'emp_addr,EmployeeCode,':U +
            'emp_title,EmployeeJobTitle,':U +
            'emp_emp_date,EmployeeStartDate,':U +
            'emp_trm_date,EmployeeEndDate,':U +
            'emp_dept,EmployeeDepartmentCode,':U +
            'emp_active,EmployeeIsActive,':U +
            'tc_status,tc_status':U.
end. /* if not can-find... */