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/bmfgaddress.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 = "ad_mstr":U and
tMfgBufferFieldMapping.tcFinancialTableName = "Address":U) then do:
create tMfgBufferFieldMapping.
assign
tMfgBufferFieldMapping.tcMfgTableName = "ad_mstr":U
tMfgBufferFieldMapping.tcFinancialTableName = "Address":U.
tMfgBufferFieldMapping.tcFieldMapping = "ad_name,AddressName,":U +
"ad_sort,AddressSearchName,":U +
"ad_line1,AddressStreet1,":U +
"ad_line2,AddressStreet2,":U +
"ad_line3,AddressStreet3,":U +
"ad_city,AddressCity,":U +
"ad_state,tcStateCode,":U +
"ad_zip,AddressZip,":U +
"ad_ctry,tcCountryCode,":U +
"ad_county,tcCountyCode,":U +
"ad_format,AddressFormat,":U +
"ad_temp,AddressIsTemporary,":U +
"ad_lang,tcLngCode,":U +
"ad_address_id,Address_ID,":U +
"ad_mod_date,LastModifiedDate,":U +
"ad_userid,LastModifiedUser,":U +
"ad_taxable,AddressIsTaxable,":U +
"ad_tax_zone,TxzTaxZone,":U +
"ad_taxc,TxclTaxCls,":U +
"ad_tax_usage,TxuTaxUsage,":U +
"ad_gst_id,AddressTaxIDFederal,":U +
"ad_pst_id,AddressTaxIDState,":U +
"ad_misc1_id,AddressTaxIDMisc1,":U +
"ad_misc2_id,AddressTaxIDMisc2,":U +
"ad_misc3_id,AddressTaxIDMisc3,":U +
"tc_status,tc_Status":U.
end.
if not can-find(tMfgBufferFieldMapping where
tMfgBufferFieldMapping.tcMfgTableName = "tAddressMaster":U and
tMfgBufferFieldMapping.tcFinancialTableName = "tqAddressByID":U) then do:
create tMfgBufferFieldMapping.
assign
tMfgBufferFieldMapping.tcMfgTableName = "tAddressMaster":U
tMfgBufferFieldMapping.tcFinancialTableName = "tqAddressByID":U
tMfgBufferFieldMapping.tcFieldMapping = "ad_line1,tcAddressStreet1,":U +
"ad_line2,tcAddressStreet2,":U +
"ad_line3,tcAddressStreet3,":U +
"ad_zip,tcAddressZip,":U +
"ad_city,tcAddressCity,":U +
"ad_state,tcAddressState,":U +
"ad_county,tcCountyCode,":U +
"ad_state,tcStateCode,":U +
"ad_ctry,tcCountryCode,":U +
"ad_lang,tcLngCode,":U +
"ad_name,tcAddressName,":U +
"ad_sort,tcAddressSearchName,":U +
"ad_address_id,tiAddress_ID,":U +
"ad_mod_date,ttLastModifiedDate,":U +
"ad_type,tcAddressTypeCode,":U +
"ad_taxable,tlAddressIsTaxable,":U +
"ad_tax_zone,tcTxzTaxZone,":U +
"ad_taxc,tcTxclTaxCls,":U +
"ad_tax_usage,tcTxuTaxUsage,":U +
/*CA668581*/ "ad_tax_in,tlAddressIsTaxIncluded,":U +
"ad_gst_id,tcAddressTaxIDFederal,":U +
"ad_pst_id,tcAddressTaxIDState,":U +
"ad_misc1_id,tcAddressTaxIDMisc1,":U +
"ad_misc2_id,tcAddressTaxIDMisc2,":U +
"ad_misc3_id,tcAddressTaxIDMisc3,":U +
"ad_format,tiAddressFormat,":U +
"ad_userid,tcLastModifiedUser":U.
end.