Skip to main content
Solved

PXProcessing BQL Question

  • 9 August 2024
  • 2 replies
  • 26 views

Hello, 

I am creating a processing screen that pulls in shipment records of the receipt type and running into a small issue when creating the BQL statement to do so. You’ll notice below I am trying to join an enclosed condition with the condition to check if the shipment is of the type receipt. I’m not entirely sure what to add inbetween the commas after the “Where<SOShipment.Operation,” as I can’t simply type “R” (value stored in SQL). Is there a way to go about this? 

public PXProcessing<SOShipment, Where<SOShipment.operation,, And<Where<SOShipmentExt.usrToTransfer, IsNull, Or<SOShipmentExt.usrToTransfer.IsEqual<False>>>>>> shipments;

SQL:

select * from SOShipment
where Operation = 'R' and
(UsrToTransfer is null or UsrToTransfer = 0)

Thanks,

Adam

Use this instead:

public PXProcessing<SOShipment, Where<SOShipment.operation, Equal<SOOperation.receipt>, And<Where<SOShipmentExt.usrToTransfer, IsNull, Or<SOShipmentExt.usrToTransfer.IsEqual<False>>>>>> shipments;

If SOOperation.receipt didn’t exist, you could make your own constant like this:

public class constantR : PX.Data.BQL.BqlString.Constant<constantR>
{
public constantR() : base("R") { }
}

 


@darylbowman The SOOperation.receipt worked perfect! Thanks so much. I appreciate the “constant” tip also, I will definitely remember that for future projects as I wasn’t sure how to utilize strings in those statements. Thanks again! 


Reply