AL icon indicating copy to clipboard operation
AL copied to clipboard

Filter Set through filtergroup on dimension field shows up on page.

Open shashiBssi opened this issue 6 years ago • 13 comments

steps: in the us container. create an extension app and extend sales invoice list page and on its onopenpage trigger put filter on dimension value using filtergroup.

image

now publish the app and go to sales invoice list page. try to filter on dimension 1 (department code). It will show the filter set using filtergroup. image

even after chaning the value in the filter field i the page, it keep showing the same filters set through filtergroup.

we have tried with other filter groups, same issue

shashiBssi avatar Jun 02 '20 11:06 shashiBssi

FilterGroup(2) is used to set filters that cannot be changed manually on the page. If you want to set some default filters that can be changed then do not use FilterGroup(2). What is the expected result for you? What did you want to achieve?

StanPesotskiy avatar Jun 02 '20 12:06 StanPesotskiy

i want to filter the sales invoice list page , based on a concatenated string on the dimension value field. I don't want the user to be able to remove this filter, also i believe if we apply filtergroup , filter applied should not show on the page when i try to apply another filter on the same filed from ui.

shashiBssi avatar Jun 02 '20 13:06 shashiBssi

The typical usage of different filter groups considers that the field that got filtered at group 2 is not going to be available on the page for further filtering by users, e.g. document number filter in the document lines subform. Do you know samples in the App where such a field is exposed for filtering? I assume the workaround would be to fill a temporary table and then allow user to set filers on any field.

StanPesotskiy avatar Jun 02 '20 13:06 StanPesotskiy

I want to filter general ledger entry based on a concatenated string of dimension values. I don't want the user to be able to remove this filter. However user can set their own filter on top of it. I cannot use the work around.

concatenated string is showing up. i don't want.

filter is behaving erratically , sometime all filter are removed.

shashiBssi avatar Jun 25 '20 11:06 shashiBssi

The typical usage of different filter groups considers that the field that got filtered at group 2 is not going to be available on the page for further filtering by users

Right. And the problem here is that apparently it is. That should not happen: filters set in group 2 should be hidden from the user and applied regardless of their own (group 0) filters.

dzzzb avatar Jun 25 '20 12:06 dzzzb

Hi @shashiBssi, I tried your code and it worked as expected on my side. As @StanPesotskiy mentioned the FilterGroups other then 0 can not be changed by user, for details see https://docs.microsoft.com/en-us/dynamics-nav/filtergroup-function--record-. FilterGroup 2 is not intended to be available on the page. How did you manage to make it visible, any specific steps? Could you also provide the BC/AL version you use. Thank you. ALProject55.zip

AndreyKorepanov avatar Jun 27 '20 23:06 AndreyKorepanov

Also, when i filter on this field on top of extension applied filter, it is filtering erratically. For first value it filters good. 2, 3 different value attempts .... it shows all data.

create 2 sales invoice one with department ADM another with department PROD.

first sales invoice list will show above two invoice.

filter by ADM.... will show one invoice filter by PROD.. will show one invoice filter by ADM... will show TWO invoice (situation) ..... should be only one invoice....

shashiBssi avatar Jul 07 '20 11:07 shashiBssi

image

shashiBssi avatar Jul 07 '20 11:07 shashiBssi

I can replicate that now that it has been clarified. By revealing filters, adding an empty filter on Department Code, hiding filters, and then revealing filters again, suddenly the filter pane shows ADM|PROD from FilterGroup(2).

dzzzb avatar Jul 07 '20 11:07 dzzzb

Also, when i filter on this field on top of extension applied filter, it is filtering erratically. For first value it filters good. 2, 3 different value attempts .... it shows all data.

create 2 sales invoice one with department ADM another with department PROD.

first sales invoice list will show above two invoice.

filter by ADM.... will show one invoice filter by PROD.. will show one invoice filter by ADM... will show TWO invoice (situation) ..... should be only one invoice....

shashiBssi avatar Jul 07 '20 11:07 shashiBssi

any update on this @AndreyKorepanov @dtkb

shashiBssi avatar Oct 13 '20 10:10 shashiBssi

Dunno why you're asking me, since I'm just a random user like you, but what I can say is that usually if there is an update then the devs would post it, and asking "any update" just bothers everyone else with useless emails.

dzzzb avatar Oct 13 '20 10:10 dzzzb

Looks like fixed in v17 of BC

shashiBssi avatar Oct 13 '20 11:10 shashiBssi