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;