I have a DAC on my SO Shipping graph extension.
My goal is to adapt this working selector to only show records that are related to a SOShipment that is of status Hold or Open and the SOShipLineSplit.inventoryID is equal to the inventory ID in the filter.
The following selector (the one not commented out) is throwing an error at runtime.
#region FromLotSerialNbr
/PXString(200, IsUnicode = true)]
/PXUIField(DisplayName = "To Serial Number")]
/PXSelector(typeof(SelectFrom<SOShipLineSplit>
.Where<SOShipLineSplit.lotSerialNbr.IsNotLike<Empty>
.And<SOShipLineSplit.inventoryID.IsEqual<SwapFilter.inventoryID.FromCurrent>>>),
typeof(SOShipLineSplit.shipmentNbr),
typeof(SOShipLineSplit.lotSerialNbr))]
///PXSelector(typeof(SelectFrom<SOShipLineSplit>
// .InnerJoin<SOShipment>.On<SOShipment.shipmentNbr.IsEqual<SOShipLineSplit.shipmentNbr>>
// .Where<SOShipLineSplit.lotSerialNbr.IsNotLike<Empty>
// .And<SOShipLineSplit.inventoryID.IsEqual<SwapFilter.inventoryID.FromCurrent>>
// .And<Brackets<SOShipment.status.IsEqual<PX.Objects.SO.SOShipmentStatus.hold>>
// .Or<SOShipment.status.IsEqual<PX.Objects.SO.SOShipmentStatus.open>>>>),
// typeof(SOShipLineSplit.shipmentNbr),
// typeof(SOShipLineSplit.lotSerialNbr))]
public virtual string ToLotSerialNbr { get; set; }
public abstract class toLotSerialNbr : PX.Data.BQL.BqlString.Field<toLotSerialNbr> { }
#endregion
The error is
If I leave out the .And<SOShipLineSplit.inventoryID.IsEqual<SwapFilter.inventoryID.FromCurrent» it works but not the result I want.
I further want to link this selector to the SOShipments table and only get records where the Shipment is OPEN or HOLD. That is the second selector that is commented out. If I can at least get the non commented selector working, I will deal with that when I get there.
I might be able to do this with a SQL View, but I really try not to use them unless I have to.