Skip to main content
Solved

Is there any way to do a Fluent BQL equivalent of PXSelectorAttribute?


Tony Lanzer
Semi-Pro II
Forum|alt.badge.img+1

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?

Best answer by Leonardo Justiniano

Hi @Tony Lanzer 

 

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

// INItemClass.cs

[PXSelector(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.

View original
Did this topic help you find an answer to your question?

5 replies

Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+4

Hi @Tony Lanzer 

 

Just add at the end the clause SearchFor
 

Then you can build your query in BQL Fluent style


darylbowman
Captain II
Forum|alt.badge.img+13

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


Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+4

Hi @Tony Lanzer 

 

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

// INItemClass.cs

[PXSelector(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.


darylbowman
Captain II
Forum|alt.badge.img+13
darylbowman wrote:

For the sake of learning...

Nevermind, I now see clearly


Tony Lanzer
Semi-Pro II
Forum|alt.badge.img+1
  • Author
  • Semi-Pro II
  • 79 replies
  • July 30, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings