Skip to main content
Solved

new 26R1 error: A PXGraphExtension instance has been passed as a query parameter to the Select method

  • June 19, 2026
  • 7 replies
  • 38 views

Forum|alt.badge.img+2

After upgrading to 26R1, I’m now getting this new Exception (didn’t happen in 24R1):

"A PXGraphExtension instance has been passed as a query parameter to the Select method."

This happens on a Select using the POLine object:

 public class POMaintExtension : PXGraphExtension<POOrderEntry>
    {

        public SelectFrom<POLine>
              .Where<POLine.orderNbr.IsEqual<
             POOrder.orderNbr.FromCurrent>>
            .View POLineView;

        private void DeviceHubPrint()
        {
            foreach (object objPOL in POLineView.SelectMain(this)) //throw Exception

...

Question: did something change with POLine causing this new behavior?

Best answer by SaiKrishnaV

@bpgraves 

I tested the code by calling POLineView.SelectMain() without passing any parameter, and it works with no error.

As shown in the screenshot,

PXSelectBase<POLine>.SelectMain(params object[] arguments)

This indicates that the method accepts optional arguments (params object[]), so it can be called without passing this or Base.
Can you chekc this?

7 replies

Samvel Petrosov
Jr Varsity III
Forum|alt.badge.img+9

Try replacing 
 

foreach (object objPOL in POLineView.SelectMain(this))

with

foreach (object objPOL in POLineView.SelectMain(this.Base))

there might be mulptiple .Base options like .Base1, .Base2 if this is an extension of graph with other extensions. You want to make sure that you are passing the one that actually is the PXGraph (POOrderEntry, SOOrderEntry, etc.) and not PXGraphExtension.


Forum|alt.badge.img+1
  • Semi-Pro III
  • June 19, 2026

try replacing with this 
POLineView.SelectMain(Base)


Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • June 22, 2026

Try replacing 
 

foreach (object objPOL in POLineView.SelectMain(this))

with

foreach (object objPOL in POLineView.SelectMain(this.Base))

there might be mulptiple .Base options like .Base1, .Base2 if this is an extension of graph with other extensions. You want to make sure that you are passing the one that actually is the PXGraph (POOrderEntry, SOOrderEntry, etc.) and not PXGraphExtension.

I tried but I get the same error and there aren’t multiple Base options.  The Base has always been PXGraphExtension (see code in original post).  It worked in 24R1.  So I can no longer create an extension off PXGraphExtension in 26R1?


Forum|alt.badge.img+3
  • Pro III
  • Answer
  • June 23, 2026

@bpgraves 

I tested the code by calling POLineView.SelectMain() without passing any parameter, and it works with no error.

As shown in the screenshot,

PXSelectBase<POLine>.SelectMain(params object[] arguments)

This indicates that the method accepts optional arguments (params object[]), so it can be called without passing this or Base.
Can you chekc this?


Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • June 23, 2026

@bpgraves 

I tested the code by calling POLineView.SelectMain() without passing any parameter, and it works with no error.

As shown in the screenshot,

PXSelectBase<POLine>.SelectMain(params object[] arguments)

This indicates that the method accepts optional arguments (params object[]), so it can be called without passing this or Base.
Can you chekc this?

That worked but it seems like all my Select() statements need to change now.  For instance, this code…

            foreach (object objPOL in POLineView.SelectMain())
            {
                POLine pol = (POLine)objPOL;
                int invID = (int)pol.InventoryID;

                PX.Objects.IN.InventoryItem itm = PXSelect<PX.Objects.IN.InventoryItem, Where<InventoryItem.inventoryID, Equal<Required<PX.Objects.IN.InventoryItem.inventoryID>>>>.Select(this.Base, invID);
                PX.Objects.IN.INItemSite site = PXSelect<PX.Objects.IN.INItemSite, Where<PX.Objects.IN.INItemSite.inventoryID, Equal<Required<PX.Objects.IN.INItemSite.inventoryID>>,
                    And<PX.Objects.IN.INItemSite.isDefault, Equal<Required<PX.Objects.IN.INItemSite.isDefault>>>>>.Select(this.Base, itm.InventoryID, true);

...now throws an exception:

“The multi-part identifier "INItemSite.IsDefault" could not be bound.”


Forum|alt.badge.img+3
  • Pro III
  • June 23, 2026

@bpgraves The issue appears to be with the Incorrect BQL in INItemSite.isDefault.

Try changing the query to:

InventoryItem itm = InventoryItem.PK.Find(this, invID);INItemSite site =PXSelect<INItemSite,Where<INItemSite.inventoryID, Equal<Required<INItemSite.inventoryID>>,And<INItemSite.isDefault, Equal<True>>>>.Select(this.Base, itm.InventoryID);

Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • June 23, 2026

@bpgraves The issue appears to be with the Incorrect BQL in INItemSite.isDefault.

Try changing the query to:

InventoryItem itm = InventoryItem.PK.Find(this, invID);INItemSite site =PXSelect<INItemSite,Where<INItemSite.inventoryID, Equal<Required<INItemSite.inventoryID>>,And<INItemSite.isDefault, Equal<True>>>>.Select(this.Base, itm.InventoryID);

Same error...only the first line of your code (PK.Find) was different.  This works though for the 2nd line:

INItemSite site = INItemSite.PK.Find(this.Base, itm.InventoryID, siteID);