Solved

Passing a parameter to the Inventory Summary screen in code behind

  • 22 December 2023
  • 2 replies
  • 59 views

Userlevel 6
Badge +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?

 

icon

Best answer by Naveen Boga 22 December 2023, 18:17

View original

2 replies

Userlevel 7
Badge +17

@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);

Userlevel 6
Badge +3

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

You are awesome!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved