Vendor agening report customization in d 365 fo
Public class TECVendAgingReportController_Ext extends VendAgingReportController
{
public static TECVendAgingReportController_Ext construct()
{
return new TECVendAgingReportController_Ext();
}
public static void main(Args _args)
{
TECVendAgingReportController_Ext controller = TECVendAgingReportController_Ext::construct();
controller.parmReportName(ssrsReportStr(TECVendAgingReport, DesignWithNoDetailAndNoTransactionCur));
controller.parmArgs(_args);
controller.startOperation();
}
protected void preRunModifyContract()
{
// str reportDesign;
VendAgingReportContract contract = this.parmReportContract().parmRdpContract() as VendAgingReportContract;
str reportNameLocal;
if (contract.parmDetailed())
{
if (contract.parmIncludeAmountCur())
{
reportNameLocal = ssrsReportStr (TECVendAgingReport, DesignWithDetailAndWithTransactionCur);
}
else
{
reportNameLocal = ssrsReportStr(TECVendAgingReport, DesignWithDetailAndNoTransactionCur);
}
}
else
{
if (contract.parmIncludeAmountCur())
{
reportNameLocal = ssrsReportStr(TECVendAgingReport, DesignWithNoDetailAndWithTransactionCur);
}
else
{
reportNameLocal = ssrsReportStr(TECVendAgingReport, DesignWithNoDetailAndNoTransactionCur);
}
}
this.parmReportContract().parmReportName(reportNameLocal);
}
}
========================================================================
Public class TECVendAgingReportHandler
{
/// <summary>
/// Event handler for inserting the record
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[DataEventHandler(tableStr(VendAgingReportTmp), DataEventType::Inserting)]
public static void VendAgingReportTmpp_onInserting(Common sender, DataEventArgs e)
{
VendAgingReportTmp vendAgingReportTmp = sender;
vendAgingReportTmp.TECInvoiceDate = VendInvoiceJour::findFromVendTrans(VendAgingReportTmp.InvoiceId, VendAgingReportTmp.TransDate, VendAgingReportTmp.AccountNum).InvoiceDate;
}
/// <summary>
/// Post event handler for updating the record
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(classStr(VendAgingReportDP), methodStr(VendAgingReportDP, processReport))]
public static void VendAgingReportDP_Post_processReport(XppPrePostArgs args)
{
VendAgingReportDP dpInstance = args.getThis() as VendAgingReportDP;
VendAgingReportTmp vendAgingReportTmp = dpInstance.getVendAgingReportTmp();
ttsbegin;
while select forUpdate vendAgingReportTmp
{
vendAgingReportTmp.TECInvoiceDate = VendInvoiceJour::findFromVendTrans(VendAgingReportTmp.InvoiceId, VendAgingReportTmp.TransDate, VendAgingReportTmp.AccountNum).InvoiceDate;
vendAgingReportTmp.update();
}
ttscommit;
}
}
================================================================
Create a extension Output menu item & place the customization class over there "VendAgingBalance
========================================================================="
Comments
Post a Comment