Acumatica-将报告下拉列表添加到套件装配屏幕 [英] Acumatica - Add Reports dropdown to Kit Assembly Screen
问题描述
我一直试图将报告下拉列表添加到套件装配屏幕(IN307000)。我们有基于KitInventoryID的自定义报告,该报告将生成以本质上打印标签,并且这些报告需要添加到屏幕的操作中。我注意到通常在大多数报告屏幕中都会有一个传输,该传输将用于传输数据,因此我确实在顶部编写了自己的语句。这是我到目前为止所拥有的:
I have been trying to add a Reports dropdown to the Kit Assembly screen (IN307000). We have custom reports that are based on the KitInventoryID that will be generated to print a tag essentially and these reports need to be added to the actions of the screen. I noticed that there is normally a transfer in most Report screens that will be used to transfer data so I did write my own statement at the top. Here is what I have so far:
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN.Overrides.INDocumentRelease;
using PX.Objects.GL;
using PX.Objects.CM;
using System.Diagnostics;
using PX.Objects;
using PX.Objects.IN;
namespace PX.Objects.IN
{
public class KitAssemblyEntry_Extension:PXGraphExtension<KitAssemblyEntry>
{
public PXSelect<INKitRegister, Where<INKitRegister.docType, Equal<Current<INKitRegister.docType>>, And<INKitRegister.kitInventoryID, Equal<Current<INKitRegister.kitInventoryID>>>>> transfer;
public override void Initialize()
{
Report.AddMenuAction(MasterTag);
Report.MenuAutoOpen = true;
}
#region Event Handlers
public PXAction<INKitRegister> Report;
[PXButton]
[PXUIField(DisplayName = "Print Tag", MapEnableRights = PXCacheRights.Select)]
protected void report()
{ }
public PXAction<INKitRegister> MasterTag;
[PXUIField(DisplayName = "Sample/Value Tag", MapEnableRights = PXCacheRights.Select)]
[PXLookupButton]
public virtual IEnumerable masterTag(PXAdapter adapter)
{
INKitRegister doc = Base.transfer.Current;
if (doc != null)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["DocType"] = this.transfer.Current.DocType;
parameters["ItemNumber"] = this.transfer.Current.KitInventoryID.ToString();
throw new PXReportRequiredException(parameters, "IN610004", "Sample/Value Tag");
}
}
#endregion
}
}
但是,当我尝试发布时出现此错误:
However, when I try to publish I get this error:
Building directory '\WebSiteValidationDomain\App_RuntimeCode\'.
\App_RuntimeCode\KitAssemblyEntry.cs(39): error CS1061: 'PX.Objects.IN.KitAssemblyEntry' does not contain a definition for 'transfer' and no extension method 'transfer' accepting a first argument of type 'PX.Objects.IN.KitAssemblyEntry' could be found (are you missing a using directive or an assembly reference?)
\App_RuntimeCode\KitAssemblyEntry.cs(39): error CS1061: 'PX.Objects.IN.KitAssemblyEntry' does not contain a definition for 'transfer' and no extension method 'transfer' accepting a first argument of type 'PX.Objects.IN.KitAssemblyEntry' could be found (are you missing a using directive or an assembly reference?)
我也尝试过更改 INKitRegister doc = Base.transfer.Current;
到 INKitRegister doc = Base.Document.Current;
却收到此错误:
I have also tried changing the INKitRegister doc = Base.transfer.Current;
to INKitRegister doc = Base.Document.Current;
but get this error:
\App_RuntimeCode\KitAssemblyEntry.cs(37): error CS0161: 'PX.Objects.IN.KitAssemblyEntry_Extension.masterTag(PX.Data.PXAdapter)': not all code paths return a value
\App_RuntimeCode\KitAssemblyEntry.cs(37): error CS0161: 'PX.Objects.IN.KitAssemblyEntry_Extension.masterTag(PX.Data.PXAdapter)': not all code paths return a value
推荐答案
这里是固定编码,可以正常工作
Here is the fixed coded and it is working properly.
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN.Overrides.INDocumentRelease;
using PX.Objects.GL;
using PX.Objects.CM;
using System.Diagnostics;
using PX.Objects;
using PX.Objects.IN;
namespace PX.Objects.IN
{
public class KitAssemblyEntry_Extension:PXGraphExtension<KitAssemblyEntry>
{
public PXSelect<INKitRegister, Where<INKitRegister.docType, Equal<Current<INKitRegister.docType>>, And<INKitRegister.kitInventoryID, Equal<Current<INKitRegister.kitInventoryID>>>>> transfer;
public override void Initialize()
{
Report.AddMenuAction(MasterTag);
Report.MenuAutoOpen = true;
}
#region Event Handlers
public PXAction<INKitRegister> Report;
[PXButton]
[PXUIField(DisplayName = "Print Tag", MapEnableRights = PXCacheRights.Select)]
protected void report()
{ }
public PXAction<INKitRegister> MasterTag;
[PXUIField(DisplayName = "Sample/Value Tag", MapEnableRights = PXCacheRights.Select)]
[PXLookupButton]
public virtual IEnumerable masterTag(PXAdapter adapter)
{
INKitRegister doc = Base.Document.Current;
if (doc != null)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["DocType"] = this.transfer.Current.DocType;
parameters["ItemNumber"] = this.transfer.Current.KitInventoryID.ToString();
throw new PXReportRequiredException(parameters, "IN610004", "Sample/Value Tag");
}
return adapter.Get();
}
#endregion
}
}
这篇关于Acumatica-将报告下拉列表添加到套件装配屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!