Solved

Set column filters from code


Userlevel 1

Hello!

Is there any way to set a column filter from a custom action in the graph?

Like:

 

icon

Best answer by aaghaei 5 May 2023, 09:31

View original

4 replies

Userlevel 7
Badge +9

Assuming what you are showing here is result of a public view then yes you can.

If you want your public view be filtered by a fixed value like True/False or any similar constants, then just rewrite your public view in graph ext (use the same view name but with revised where statements)

If you want your view results change by some dynamic parameters, then you will need a view delegate in the graph ext which is a bit more complex. In the delegate then you can append the desired view by WhereAnd<> or WhereOr<> or even set a whole new where statement by WhereNew<>
 

Userlevel 1

Assuming what you are showing here is result of a public view then yes you can.

If you want your public view be filtered by a fixed value like True/False or any similar constants, then just rewrite your public view in graph ext (use the same view name but with revised where statements)

If you want your view results change by some dynamic parameters, then you will need a view delegate in the graph ext which is a bit more complex. In the delegate then you can append the desired view by WhereAnd<> or WhereOr<> or even set a whole new where statement by WhereNew<>
 

Thanks aaghaei.

I’ve tried using a view delegate. But the problem here is that I would like to keep the original view results, and just filter the records the user would see on the grid after executing an action.

When I tried the view delegate the results are modified on every reload.

Userlevel 7
Badge +9

It is exactly what I meant by passing parameters. If a parameter for example is provided then you filter by its value otherwise you show all. If you want the filtered result as initial display, then you can set your default parameter value in code and user can reset the filter if needed or vice versa

Userlevel 1

Thanks Aaghaei. Looks like.. This is the way!

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