2017-05-06 60 views
0

我创建了自定义条目,我需要添加一些报告。 我试图让报告下拉这样 enter image description here 但我所有的努力都是失败的。Acumatica ERP 6.0创建报告下拉

我有动作与功能像是在接到入学

public PXAction<MyMasterView> report; 

    [PXUIField(DisplayName = "Reports", MapEnableRights = PXCacheRights.Select),PXButton(SpecialType = PXSpecialButtonType.Report)] 
    protected virtual IEnumerable Report(PXAdapter adapter, [PXString(8, InputMask = "CC.CC.CC.CC"), PXStringList(new string[]{"PO649999","PO646000"}, new string[]{"Print My Report","Print Receipt"})] string reportID) 
    { 
     List<MyMasterView> list = adapter.Get<MyMasterView>().ToList<MyMasterView>(); 
     if (!string.IsNullOrEmpty(reportID)) 
     { 
      this.Save.Press(); 
      int num = 0; 
      Dictionary<string, string> dictionary = new Dictionary<string, string>(); 
      foreach (MyMasterViewcurrent in list) 
      { 
       dictionary["PARAMETER"] = current.PARAMETER; 
       num++; 
      } 
      if (num > 0) 
      { 
       throw new PXReportRequiredException(dictionary, reportID, string.Format("Report {0}", reportID)); 
      } 
     } 
     return list; 
    } 

但作为一个结果,我发现了以下

enter image description here

回答

2

有可以处理这几种方法。

的一种方法在这里另外一个问题概括: Acumatica - Add additional buttons to Actions drop down to screen CT30100

另一种方法是利用一个列表,并与自动化的步骤来控制它。

如果你看看采购订单收货屏幕,你可以看到这个。
1)创建按钮方法,它有其他的项目清单:

public PXAction<POReceipt> report; 
    [PXUIField(DisplayName = "Reports", MapEnableRights = PXCacheRights.Select)] 
    [PXButton] 
    protected virtual IEnumerable Report(PXAdapter adapter,   

    [PXString(8, InputMask = "CC.CC.CC.CC")] 
    [PXStringList(new string[] { "PO646000", "PO632000", "PO622000" }, new string[] { "Purchase Receipt", Messages.ReportPOReceiptBillingDetails, Messages.ReportPOReceipAllocated })] 
    string reportID) 
    { 
     List<POReceipt> list = adapter.Get<POReceipt>().ToList(); 
    if (string.IsNullOrEmpty(reportID) == false) 
    { 
      Save.Press(); 
     int i = 0; 
     Dictionary<string, string> parameters = new Dictionary<string, string>(); 
      foreach (POReceipt doc in list) 
     { 

      if (reportID == "PO632000") 
      { 
       parameters["FinPeriodID"] = (string)Document.GetValueExt<POReceipt.finPeriodID>(doc); 
        parameters["ReceiptNbr"] = doc.ReceiptNbr; 
      } 
      else 
      { 
        parameters["ReceiptType"] = doc.ReceiptType; 
       parameters["ReceiptNbr"] = doc.ReceiptNbr; 
      } 
      i++; 

     } 
     if (i > 0) 
     { 
      throw new PXReportRequiredException(parameters, reportID, string.Format("Report {0}", reportID)); 
     } 
    } 
     return list; 
    } 

注意,有可能的值和说明的PXStringList。

然后,您可以通过自动化步骤控制活动/非活动状态。

enter image description here

你缺少你原来的问题步骤是,你仍然需要从自动化步骤添加这些按钮将其添加到列表中。