Solved

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

  • 28 July 2023
  • 5 replies
  • 90 views

Userlevel 4
Badge +2

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?

icon

Best answer by Leonardo Justiniano 29 July 2023, 20:49

View original

5 replies

Userlevel 4
Badge +2

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

Badge +11

For the sake of learning...

Nevermind, I now see clearly

Userlevel 6
Badge +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.

Badge +11

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

Userlevel 6
Badge +4

Hi @Tony Lanzer 

 

Just add at the end the clause SearchFor
 

Then you can build your query in BQL Fluent style

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved