Skip to main content
Answer

How to filter using fluent BQL

  • November 8, 2024
  • 2 replies
  • 140 views

Forum|alt.badge.img

There is a requirement to retrieve only move transactions, which can be identified by the value of AMBatch.docType. If AMBatch.docType = 'M', it indicates a move transaction. How to write it in fluent BQL?
I used the following BQL query, but it contains an error. How can I correct it?
.Where<AMBatch.docType.IsEqual<'M'>

Best answer by noorula77

.Where<AMBatch.docType.IsEqual<MoveDocType>>

// Define the constant class (put this outside your query)
public class MoveDocType : PX.Data.BQL.BqlString.Constant<MoveDocType>

{

public MoveDocType() : base("M") { }

}

2 replies

palbores
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • November 8, 2024

@RKarunarathne51, you can refer for the BQL Fluent query here: https://help-2021r2.acumatica.com/(W(11))/Wiki/ShowWiki.aspx?pageid=67456943-7705-4522-9e0a-967251cc841c


.Where<AMBatch.docType.IsEqual<@P.AsString>.View.Select(PXGraph, ‘M’);


Forum|alt.badge.img+1
  • Jr Varsity III
  • Answer
  • November 8, 2024

.Where<AMBatch.docType.IsEqual<MoveDocType>>

// Define the constant class (put this outside your query)
public class MoveDocType : PX.Data.BQL.BqlString.Constant<MoveDocType>

{

public MoveDocType() : base("M") { }

}