Hello, friends
I have an extended system table PurchPurchaseOrderHeader_Extension. I need to add additional field and additional code line in one of the original table methods to fille the fields value. As I understand you can do it with chain of commands or pre-post method event handlers.
This is the original method code:
public void initFromVendTable(VendTable _vendTable)
{
// <GEECZ>
#ISOCountryRegionCodes
// </GEECZ>
this.VendName = _vendTable.name();
this.VendAddress = DirUtility::replaceAddressTokenLanguage(_vendTable.postalAddress(), _vendTable.languageId());
// <GEECZ>
if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoCZ]))
{
this.VendRegNum = _vendTable.getPrimaryRegistrationNumber(TaxRegistrationTypesList::UID);
this.VendCoRegNum = _vendTable.getPrimaryRegistrationNumber(TaxRegistrationTypesList::TAXID);
}
// </GEECZ>
}
I need to add code line which fills new field VendVATNum. The code could look like this:
this.VendVATNum = _vendTable.VatNum;
However, when I m little bit confused on how to pass the original methods parameters (_vendTable and this) into post event handler:
[PostHandlerFor(tableStr(PurchPurchaseOrderHeader), tableMethodStr(PurchPurchaseOrderHeader, initFromVendTable))]
public static void PurchPurchaseOrderHeader_Post_initFromVendTable(XppPrePostArgs args)
{
}
Best regards,
Roberts