我创建了一个报告,其中唯一的参数是 SOOrder 表中的 CustomerID。CustomerID 的参数与原始客户历史报告的工作方式相同,只是它使用 SOOrder.CustomerID 而不是 ARPayment.CustomerID 作为链接字段。我创建了此自定义以将链接添加到报告:
public override void Initialize()
{
Base.report.AddMenuAction(NewCustHistory);
}
public PXAction<Customer> NewCustHistory;
[PXUIField(DisplayName = "New Customer History", MapEnableRights = PXCacheRights.Select)]
[PXButton(ImageKey = PX.Web.UI.Sprite.Main.Report)]
public virtual IEnumerable newCustHistory(PXAdapter adapter)
{
Customer customer = Base.BAccountAccessor.Current;
if (customer != null)
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["CustomerID"] = customer.AcctCD;
throw new PXReportRequiredException(parameters, "IN642501", "New Customer History");
}
return adapter.Get();
}
它编译得很好,只是当我在选择客户后尝试运行报告时,我在跟踪中收到这两个错误:
Object reference not set to an instance of an object.
at PX.Data.Reports.BqlSoapCommand.a(PXGraph A_0, StringBuilder A_1, List`1 A_2)
at PX.Data.Reports.BqlSoapCommand.Parse(PXGraph graph, List`1 pars, List`1 tables, List`1 fields, List`1 sortColumns, StringBuilder text, Selection selection)
at PX.Data.BqlCommand.a(PXGraph A_0, PXView A_1)
at PX.Data.BqlCommand.GetText(PXGraph graph, PXView view)
at PX.Data.PXDatabaseProviderBase.Select(PXGraph graph, BqlCommand command, Int64 topCount, PXView view, PXDataValue[] pars)
at PX.Data.PXDatabaseProvider.Select(PXGraph graph, BqlCommand command, Int64 topCount, PXDataValue[] pars)
at PX.Data.PXDatabase.Select(PXGraph graph, BqlCommand command, Int64 topCount, PXDataValue[] pars)
更新 1:我已更新代码以复制下面提供的答案。错误仍然存在。我的 Acumatica 版本是 6.10.0755。
相关分类