Skip to main content
Answer

PXProcessing BQL Question

  • August 9, 2024
  • 2 replies
  • 62 views

Forum|alt.badge.img

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

Best answer by darylbowman

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") { }
}

 

2 replies

darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • August 9, 2024

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") { }
}

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • August 9, 2024

@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!