project QadFinancials > class BMfgCreditTermsDetail > 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/bmfgcredittermsdetail.p)

<ANCESTOR-CODE>
/* ========================================================================== */
/* Setup the field mapping that will be used to copy data from the Financials */
/* temp table data into the MFG/PRO application data temp table. This field   */
/* mapping is used during all buffer copying activties within this class.     */  
/* ========================================================================== */
if not can-find(tMfgBufferFieldMapping where
                tMfgBufferFieldMapping.tcMfgTableName       = "ctd_det":U and
                tMfgBufferFieldMapping.tcFinancialTableName = "PaymentConditionStaged":U) 
then do:	        
    create tMfgBufferFieldMapping.
    assign
        tMfgBufferFieldMapping.tcMfgTableName='ctd_det':U
        tMfgBufferFieldMapping.tcFinancialTableName='PaymentConditionStaged':U
        tMfgBufferFieldMapping.tcFieldMapping=
            'ctd_code,tcPaymentConditionCode,':U +
            'ctd_date_cd,tcStagedPaymentConditionCode,':U +
            'ctd_pct_due,PaymentConditionStagedPerc':U.
    end. /* if(not available */