0

Is it possible to redirect to a Dashboard Screen and pass dashboard parameter value on Acumatica? For example, the Customer View Dashboard on Acumatica has a parameter (see below) I would like to redirect to this screen with param value.

enter image description here

cbetabeta
  • 605
  • 6
  • 11

1 Answers1

0

In order to redirect to Dashboard screen with param values, you can use the graph of the Dashboard(s) screen and pass the parameters to the Filter Dataview of the graph. Then you can throw a PXRedirectRequiredException with Url, and graph(dashboard).

See snippet below:

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
}

See below:

enter image description here

Redirect with Parameter:

enter image description here

cbetabeta
  • 605
  • 6
  • 11