Skip to main content
Answer

Passing a parameter to the Inventory Summary screen in code behind

  • December 22, 2023
  • 2 replies
  • 150 views

Joe Schmucker
Captain II
Forum|alt.badge.img+3

I am trying to open the Inventory Summary screen with a PXRedirect and pass a parameter for the Inventory ID.

Dictionary<string, int> parameters = new Dictionary<string, int>();

var baseGraph = PXGraph.CreateInstance<InventorySummaryEnq>();

//hard coded for testing
//14998 = Inventory CD "1007"
parameters.Add("InventoryID", 14998);

throw new PXRedirectRequiredException(baseGraph, "Inventory Summary", parameters) { Mode = PXBaseRedirectException.WindowMode.Layer };

The Mode = part is because I am populating a side panel.  Since I am opening the Inventory Summary screen via Javascript from an SO Line detail, I cannot do this from a standard Side Panel.

The Inventory Summary screen opens in the Side Panel, but the Inventory ID field is not being populated.

One option to get the data and display it in a side panel using a GI.  But there are over 2000 lines of code in the Inventory Summary graph to calculate the values displayed on that screen.  I don’t think that is an option.

Is there something wrong with my redirect?

 

Best answer by Naveen Boga

@Joe Schmucker  Can you please try with the below code?

 

var InventorySummaryEnq = PXGraph.CreateInstance<InventorySummaryEnq>();
                InventorySummaryEnq.Filter.Current.InventoryID = 691;
                PXRedirectHelper.TryRedirect(InventorySummaryEnq, PXRedirectHelper.WindowMode.Layer);

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • December 22, 2023

@Joe Schmucker  Can you please try with the below code?

 

var InventorySummaryEnq = PXGraph.CreateInstance<InventorySummaryEnq>();
                InventorySummaryEnq.Filter.Current.InventoryID = 691;
                PXRedirectHelper.TryRedirect(InventorySummaryEnq, PXRedirectHelper.WindowMode.Layer);


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • December 22, 2023

Thanks @Naveen Boga.   That works great.  I never thought about setting values on the graph and just simply passing the graph!  

You are awesome!