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
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program/bmfgcustomer.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.
*/
/* As this table is defined in the MFGDatabase Componet we need to make sure the record does not exist already */
if not can-find(first tMfgBufferFieldMapping
where tMfgBufferFieldMapping.tcMfgTableName = "cm_mstr":U
and tMfgBufferFieldMapping.tcFinancialTableName = "Debtor":U)
then do:
create tMfgBufferFieldMapping.
assign
tMfgBufferFieldMapping.tcMfgTableName = "cm_mstr":U
tMfgBufferFieldMapping.tcFinancialTableName = "Debtor":U
tMfgBufferFieldMapping.tcFieldMapping = "cm_addr,DebtorCode,":U +
"cm_curr,tcCurrencyCode,":U +
"cm_type,tcDebtorTypeCode,":U +
"cm__qadl01,DebtorIsInvoiceByAuth,":U +
"cm_bill,tcBillToDebtorCode,":U +
"cm_active,DebtorIsActive,":U +
"cm_cr_terms,tcNormalPaymentConditionCode,":U +
"cm_tax_zone,TxzTaxZone,":U +
"cm_taxc,TxclTaxCls,":U +
"cm_tax_usage,TxuTaxUsage,":U +
"cm_gst_id,DebtorTaxIDFederal,":U +
"cm_pst_id,DebtorTaxIDState ,":U +
"cm_misc1_id,DebtorTaxIDMisc1,":U +
"cm_misc2_id,DebtorTaxIDMisc2,":U +
"cm_misc3_id,DebtorTaxIDMisc3,":U +
"cm_taxable,DebtorIsTaxable,":U +
"cm_tax_in,DebtorIsTaxIncluded,":U +
"cm_tax_in_city,DebtorIsTaxInCity,":U +
"tc_status,tc_Status":U.
end.