问题
I'd like to add a report to the dropdown menu of the Inventory Transfers screen. After searching Stack Overflow, I found the following example, but as it seemingly always happens, it doesn't seem to apply to this screen (the example is for the APPaymentEntry BLC):
public class APPaymentEntry_Extension : PXGraphExtension<APPaymentEntry>
{
public override void Initialize()
{
Base.action.AddMenuAction(ShowURL);
}
public PXAction<APPayment> ShowURL;
[PXUIField(DisplayName = "Print Remittance")]
[PXButton]
protected virtual void showURL()
{
APPayment doc = Base.Document.Current;
if (doc.RefNbr != null)
{
throw new PXReportRequiredException(doc, "AP991000", null);
}
}
}
There is no Base.action.AddMenuAction method for the graph extension for INTransferEntry.
How can I add a report to launch to this menu for Inventory Transfers?
回答1:
Based on my experience, the Actions button is usually represented by the action BLC member and the Reports button is represented by the report BLC member.
The following code snippet should add a report to the Inventory Transfers dropdown menu for reports:
public class INTransferEntryExt : PXGraphExtension<INTransferEntry>
{
public override void Initialize()
{
Base.report.AddMenuAction(ShowCustomReport);
}
public PXAction<INRegister> ShowCustomReport;
[PXButton]
[PXUIField(DisplayName = "Show Custom Report")]
protected void showCustomReport()
{
INRegister doc = Base.transfer.Current;
if (doc != null && doc.RefNbr != null)
{
throw new PXReportRequiredException(...);
}
}
}
来源:https://stackoverflow.com/questions/45218026/how-to-add-report-to-inventory-transfers-dropdown-menu-for-reports