Skip to main content
Question

Change the available records is a Tree selector on the SS Portal

  • June 3, 2026
  • 1 reply
  • 14 views

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

On the self service portal, when you open the Catalogue, you can select a Category which populates from the Item Sales Categories screen on the main site.

We don’t want to display ALL categories.  I added a custom field to the screen to indicate that we want to show the selected category on the portal.

 

I think I found where the Categories selector is populated on the SSP.

public class PXSelectCategoriesTree : PXSelectBase<INCategory>
{
public PXSelectCategoriesTree(PXGraph graph)
{
this.View = CreateView(graph, new PXSelectDelegate<int?>(categories));
}

public PXSelectCategoriesTree(PXGraph graph, Delegate handler)
{
this.View = CreateView(graph, handler);
}

private PXView CreateView(PXGraph graph, Delegate handler)
{
return new PXView(graph, false,
new Select<INCategory,
Where<INCategory.parentID, Equal<Argument<int?>>>,
OrderBy<Asc<INCategory.sortOrder>>>(),
handler);
}

internal IEnumerable categories([PXInt] int? CategoryID)
{
if (CategoryID == null)
CategoryID = 0;

foreach (var ret in PXSelect<INCategory,
Where<INCategory.parentID, Equal<Required<INCategory.parentID>>>,
OrderBy<Asc<INCategory.sortOrder>>>
.Select(new PXGraph(), CategoryID))
{

//CHECK HERE IF I SHOULD YIELD THE RECORD

yield return ret;
}
}
}

I want to be able to add a restriction in the internal IEnumerable categories([PXInt] int? CategoryID) to allow me to check if the category is designated to Display on Portal from my custom field.

There aren’t many lines of code here, so maybe I can just overwrite the entire class???  

I tried to the code below, but the code doesn’t even fire in debug mode.  I was hoping there was just a simple way to “reject” the category as it is being selected, but I don’t think this is going to work, ever.

I’m showing this code just to prove I tried something…  :-)

	protected virtual void InventoryLineFilter_RowSelecting(PXCache cache, PXRowSelectingEventArgs e, PXRowSelecting InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (InventoryLineFilter)e.Row;
if (row == null) return;

InventoryLineFilter filter = Base.Filter.Current;

if (filter == null) return;

INCategory category = SelectFrom<INCategory>.Where<INCategory.categoryID.IsEqual<@P.AsInt>>
.View.Select(Base, row.CategoryID);

CummingsSSPINCategoryExt ext = category.GetExtension<CummingsSSPINCategoryExt>();
if (ext == null) return;

if (ext.UsrDisplayOnPortal != true)
{
e.Cancel = true;
}
}

Not only do I need to restrict the Category selector, I will also need to restrict the default records showing in the grid when the screen is first opened.  By default, it lists everything.   Baby steps.

1 reply

Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • June 6, 2026

I don’t think it is possible to use an extension to do what I need here.  As such...

I made a copy of SP700000 and named it IC700000.  I copied the code from the original graph, made a few tweaks to it.  I also copied the projection used for that screen and made a few changes.

Works great.  If the original changes in the future, it will be super easy to just recopy it and make the few changes I needed to in order to add a Category restriction.