Solved

PXResultSet error "does not contain a definition for Select

  • 22 February 2024
  • 11 replies
  • 51 views

Userlevel 2
Badge

Using V2023R2 trying to retrieve quantities from INSiteStatus in a processing program.

Error:

 

Error is on the .Select line that is in red in the code shown below:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Diagnostics;
using PX.Data;
using PX.Objects;
using PX.Data.BQL.Fluent;
using PX.Data.BQL;
using PX.Data.ReferentialIntegrity.Attributes;
using static PX.Api.SYMapping;
using MCB_Custom.MspData;
using PX.Objects.IN;
using PX.Objects.SO;

namespace MCBCustom
{
    public class FixMSPDataAlloc : PXGraph<FixMSPDataAlloc>
    {

        public PXCancel<MSPDataResult> Cancel;
        public PXProcessing<MSPDataResult> ResultView;

        public FixMSPDataAlloc()
        {
            ResultView.SetProcessDelegate(ProcessFixMSPDataAlloc);
            ResultView.SetProcessCaption("");  // not used in this program
            ResultView.SetProcessAllCaption("Process All");
        }
        public static void ProcessFixMSPDataAlloc(List<MSPDataResult> importSettings)
        {
            InventoryItemMaint graph = PXGraph.CreateInstance<InventoryItemMaint>();

            PXResultset<InventoryItem, INSiteStatus, INSite> result = SelectFrom<InventoryItem>
                .InnerJoin<INSiteStatus>.On<InventoryItem.inventoryID.IsEqual<INSiteStatus.inventoryID>>
                .InnerJoin<INSite>.On<INSiteStatus.siteID.IsEqual<INSite.siteID>>
                .Where<InventoryItem.stkItem.IsEqual<@P.AsBool>
                .And<InventoryItem.itemStatus.IsEqual<@P.AsString>>>
                .Select(graph, true, "AC");

            foreach (PXResult<InventoryItem, INSiteStatus, INSite> record in result)
            {
                InventoryItem resItem = (InventoryItem)record;
                INSiteStatus resStatus = (INSiteStatus)record;
                INSite resSite = (INSite)record;

 

icon

Best answer by darylbowman 22 February 2024, 14:36

View original

11 replies

Badge +11

For F-bql, you need View.Select()

Userlevel 2
Badge

Thanks Daryl.  Now I am to a new error.

 

Badge +11

Try this:

var result = (PXResultset<InventoryItem, INSiteStatus, INSite>)SelectFrom<InventoryItem.InnerJoin<INSiteStatus>.On<InventoryItem.inventoryID.IsEqual<INSiteStatus.inventoryID>>.InnerJoin<INSite>.On<INSiteStatus.siteID.IsEqual<INSite.siteID>>.Where<InventoryItem.stkItem.IsEqual<@P.AsBool>.And<InventoryItem.itemStatus.IsEqual<@P.AsString>>>.View.Select(graph, true, "AC");

Userlevel 2
Badge

Perfect.  That worked.  Thank-you very much!

Badge +11

Fantastic. Could you mark that as the answer?

Userlevel 2
Badge

Sorry I clicked on the wrong part as best answer.  Not sure how to undo that and make the actually code reply as the best answer.

Badge +11

@Chris Hackett can

Badge +11

Ha, just realized who this is. Good to see you 😁

Userlevel 2
Badge

I got a chuckle out of you answering.  I am still working on how to split out a project for you.  Thanks for your help today.

Badge +11

I got a chuckle out of you answering.

It’s good marketing 😉

Happy to help!

Userlevel 7
Badge

I have fixed the best answer 😀

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