Is there an easier way to add an attribute to a data view?

  • 15 June 2023
  • 2 replies

Badge +12

Several times recently, I’ve had to add a simple attribute above a data view declaration. For a simple data view, this is as easy as redefining the data view and adding the attribute. However, if the data view has a data view delegate, and the data view delegate calls private methods, the amount of copy/paste code needed in order to add a single line of code is ridiculous.

Am I missing an easier way to do this? It feels like there should be an event or something to use, similar to adding an attribute to a DAC field on CacheAttached.

2 replies

Userlevel 3
Badge +2

Can you share an example of the View you want to modify and what you have already tried?

Depending on the specific View you need to modify there could be alternatives.

If you just need to add attributes like PXFilterable, then you can extend the Graph, override the View and would need to copy and paste the existing BQL (here you are right about the copy and pasting). That should be enough, since the Extension would invoke the Base view delegate.

If, for example, you need to add a condition, you can override the view delegate, call one of the PXView methods (WhereAnd, WhereNew, WhereNot, etc.) inside it to modify the Base view BQL and then return the Base delegate which should use the modified BQL. This may not work in all cases, as some delegates are more complex than others, but it's worth looking into.



Badge +12

It's usually the first one, adding PXFilterable, PXImport, PXCopyPasteHiddenFields, etc.


The original post is 8 months old. I don't remember what the situation was. I just searched for something similar and found it again, unanswered. I do recall wanting to add PXImport to a detail tab, which you can imagine was more complex than most.


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