如何重定向到仪表板并传递参数值
How to Redirect to a Dashboard and pass parameter value
是否可以重定向到仪表板屏幕并在 Acumatica 上传递仪表板参数值?例如,Acumatica 上的客户视图仪表板有一个参数(见下文)我想使用参数值重定向到此屏幕。
为了重定向到具有参数值的仪表板屏幕,您可以使用仪表板屏幕的图表并将参数传递给图表的过滤器数据视图。
然后你可以用 Url 和 graph(dashboard).
抛出 PXRedirectRequiredException
参见下面的代码片段:
public class CustomerMaint_Extension : PXGraphExtension<CustomerMaint>
{
#region Event Handlers
public PXAction<PX.Objects.AR.Customer> Test;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "test")]
protected void test()
{
Customer customer = Base.BAccount.Current;
if (customer != null)
{
string screenID = "DB000031";
PXSiteMapNode sm = GIScreenHelper.GetSiteMapNode(screenID);
PXGraph graph = GIScreenHelper.InstantiateGraph(screenID);
if (graph is LayoutMaint)
{
LayoutMaint copygraph = graph as LayoutMaint;
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters["CustomerAccountID"] = customer.AcctCD;
copygraph.Filter.Current.Values = parameters;
throw new PXRedirectRequiredException(sm.Url, copygraph, PXBaseRedirectException.WindowMode.New, String.Empty);
}
}
}
#endregion
}
见下文:
重定向参数:
是否可以重定向到仪表板屏幕并在 Acumatica 上传递仪表板参数值?例如,Acumatica 上的客户视图仪表板有一个参数(见下文)我想使用参数值重定向到此屏幕。
为了重定向到具有参数值的仪表板屏幕,您可以使用仪表板屏幕的图表并将参数传递给图表的过滤器数据视图。 然后你可以用 Url 和 graph(dashboard).
抛出 PXRedirectRequiredException参见下面的代码片段:
public class CustomerMaint_Extension : PXGraphExtension<CustomerMaint>
{
#region Event Handlers
public PXAction<PX.Objects.AR.Customer> Test;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "test")]
protected void test()
{
Customer customer = Base.BAccount.Current;
if (customer != null)
{
string screenID = "DB000031";
PXSiteMapNode sm = GIScreenHelper.GetSiteMapNode(screenID);
PXGraph graph = GIScreenHelper.InstantiateGraph(screenID);
if (graph is LayoutMaint)
{
LayoutMaint copygraph = graph as LayoutMaint;
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters["CustomerAccountID"] = customer.AcctCD;
copygraph.Filter.Current.Values = parameters;
throw new PXRedirectRequiredException(sm.Url, copygraph, PXBaseRedirectException.WindowMode.New, String.Empty);
}
}
}
#endregion
}
见下文:
重定向参数: