Skip to main content

I wanted to change a PXSelector attribute on a DAC field to Fluent BQL syntax if possible in order to include a subquery. Is there any way to do a Fluent BQL equivalent of PXSelector that you know of?

Hi @Tony Lanzer 

 

Just add at the end the clause SearchFor
 

Then you can build your query in BQL Fluent style


@Tony Lanzer - For the sake of learning, blah blah, could you explain what you're doing?


Hi @Tony Lanzer 

 

😄 I rushed to give you the missing piece. Here is an example extracted from Acumatica itself

// INItemClass.cs

bPXSelector(typeof(SearchFor<CSAttributeGroup.attributeID>.
Where<CSAttributeGroup.entityClassID.
IsEqual<PX.Data.BQL.RTrim<Use<itemClassID.FromCurrent>.AsString>>.
And<CSAttributeGroup.entityType.IsEqual<Common.Constants.DACName<InventoryItem>>>.
And<CSAttributeGroup.attributeCategory.
IsEqual<CSAttributeGroup.attributeCategory.variant>>.
And<CSAttributeGroup.attributeID.
IsNotEqual<defaultRowMatrixAttributeID.FromCurrent>.
Or<defaultRowMatrixAttributeID.FromCurrent.IsNull>>>),
typeof(CSAttributeGroup.attributeID),
DescriptionField = typeof(CSAttributeGroup.description))]

You can do your complex query using FBQL. However, I have had some weird behaviors in the past. I think last versions of Acumatica have fixed it. Give it a try.


For the sake of learning...

Nevermind, I now see clearly


Thanks @Leonardo Justiniano!  I was looking for an example and hadn’t yet tracked one down.  I will give that a try.


Reply