
Hello,
I'm new to D365 F&O extensions development. I'm attempting to extend our FreeTextInvoice report and I'm having issues:
I've created a PostHandler for the report as follows:
internal final class FreeTextInvoiceEvents
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(classStr(FreeTextInvoiceDP), methodStr(FreeTextInvoiceDP, processReport))]
public static void FreeTextInvoiceDP_Post_processReport(XppPrePostArgs args)
{
FreeTextInvoiceDP dpInstance = args.getThis() as FreeTextInvoiceDP;
FreeTextInvoiceHeaderFooterTmp freeTextInvoiceHeaderFooterTmp = dpInstance.getFreeTextInvoiceHeaderFooterTmp();
FreeTextInvoiceTmp freeTextInvoiceTmp = dpInstance.getFreeTextInvoiceTmp();
CompanyInfo companyInfo = companyInfo::find();
ttsbegin;
while select forUpdate freeTextInvoiceHeaderFooterTmp
{
freeTextInvoiceHeaderFooterTmp.amtRemitToAddress = DirParty::getPostalAddressByType(companyInfo.RecId, LogisticsLocationRoleType::RemitTo);
freeTextInvoiceHeaderFooterTmp.update();
}
ttscommit;
}
}
I need to add custom fields from SalesTable and CustInvoiceTable to the report.
I am trying to link the SalesTable to the FTI by Acct and PurchaseOrder, but I do not have the means to reference CustinvoiceTable or CustinvoiceJour in this class to add fields, then link SalesTable, even though it is those tables that populate the tmp table in the DP.
Do I have to extend the FreeTextInvoiceDP differently to get this accomplished?
Can you point me in the right direction for getting the fields added and the link accomplished so I can then update the fields on the report?
Thanks,
Steve