How to add report to Inventory Transfers dropdown menu for reports

送分小仙女□ 提交于 2019-12-12 04:38:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!