[英]Adding custom action to Special Folders of action menu on Bills and Adjustments (AP301000) screen
I would like to add a custom action to the Bills and Adjustments (AP301000) screen which navigates to a report.我想向导航到报告的账单和调整 (AP301000) 屏幕添加自定义操作。 I want to add the action to the special folder in acumatica (action menu) as shown on screenshot 1 where the red line is.我想将操作添加到 acumatica(操作菜单)中的特殊文件夹,如屏幕截图 1 所示,红线所在的位置。
Screenshot 1: Action Menu截图 1:操作菜单
Below code is used to add the action to the menu下面的代码用于将操作添加到菜单
public class APInvoiceEntry_Extension : PXGraphExtension<PX.Objects.AP.APInvoiceEntry>
{
public override void Initialize()
{
base.Initialize();
//this added the report to the reports menu
Base.report.AddMenuAction(SupplierInvoice);
}
public PXAction<PX.Objects.AP.APInvoice> SupplierInvoice;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Supplier Invoice")]
protected void supplierInvoice()
{
if (Base.Document.Current.RefNbr != string.Empty)
{
//create parameters for report! Check report by editing it to see what reports are needed
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["RefNbr"] = Base.Document.Current.RefNbr.ToString();
parameters["DocType"] = Base.Document.Current.DocType;
//the report number gets set below and parameters are sent with
throw new PXReportRequiredException(parameters, "AP641500");
}
}
}
}
The error which I get is shown in below screenshot我得到的错误显示在下面的屏幕截图中
Screenshot 2: Code error截图 2:代码错误
The issue I encountered is that the report folder for the Bills and Adjustments (AP301000) screen in the screen editor of the customization does not the Layout Properties as shown in the screenshot below:我遇到的问题是自定义的屏幕编辑器中的账单和调整(AP301000)屏幕的报告文件夹没有布局属性,如下面的屏幕截图所示:
Screenshot 3: Bill and Adjustments (AP301000) Screen Editor屏幕截图 3:账单和调整 (AP301000) 屏幕编辑器
The Acumatica Version I am currently using is: 22.101.0085我目前使用的 Acumatica 版本是:22.101.0085
How could I possibly fix the error in order to add the action in the action menu of the screen?我怎么可能修复错误以便在屏幕的操作菜单中添加操作?
You can apply a Category to the action that should position it correctly in the category:您可以将类别应用到应该在类别中正确定位的操作:
public override void Initialize()
{
base.Initialize();
SupplierInvoice.SetCategory("Reports");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.