Function to get all filters on a record

I was wondering if there’s a standard function in Navision (we use 3.6) that shows all filters put on a record? I want to use this in the header of reports, so users can always see what filters are used. Now I use FILTERGROUP(x) a couple of times and put the result in a global text-variable. This works. I now want to make a generic function so I can use it easy in every report, but it would be regrettable if there already is a function present in Navision. Does anyone know?

I’m not sure if I understand you correctly, GETFILTERS seem to obvious [8D]

As far as I know, GETFILTERS only get’s the filters on ONE filtergroup (the active one). So you need to write a function which does the following: Take a RecRef as parameter and return a text. Loop through all FILTERGROUPS on that recRef and call GETFILTERS for each group combine a string (attention, max is 1024) and return it.

GETFILTERS is to obvious… [:)] I’m looking for a function like this: FILTERGROUP(1); txtFilters := txtFilters + record.GETFILTERS; FILTERGROUP(2); txtFilters := txtFilters + record.GETFILTERS; …

Sorry, I forgot the HOWTOUSEIT: After that you can call a RecRef.GETTABLE(xxx); and then call your function with that RecRef. You should get all filters back.

Thomas, Thank you. If I understand you well, there’s no standard function in Navision?

Stupid question maybe, but why are you using FILTERGROUP in a report?

I’m using FILTERGROUP in combination with GETFILTERS to get all the filters on a record. And in the header of the report I’m printing these filters.

Yes, I realize that, but you’re not using FILTERGROUP to SET any filters are you? In other words it’s the filter(s) set directly on the DataItemTableView you want to get, right? Have you considered moving these to the OnPreDataItem?

Do you use FILTERGROUP in the form before you run the report?

quote:

Yes, I realize that, but you’re not using FILTERGROUP to SET any filters are you?

No, just to GET them.

quote:

In other words it’s the filter(s) set directly on the DataItemTableView you want to get, right?

Yep.

quote:

Have you considered moving these to the OnPreDataItem?

No. But I still would have to get filters from different filtergroups. I’m going to make the generic function the way Thomas suggested.

quote:

Do you use FILTERGROUP in the form before you run the report?
Originally posted by marq - 2005 Dec 15 : 10:14:27

It’s not a report that’s been called from a form. Why? Is there something I should consider then?

Nope. Just curious what it is you are doing with filtergroups in a report that cannot be solved without them.

quote:

Have you considered moving these to the OnPreDataItem? No. But I still would have to get filters from different filtergroups.

Well, if you move the filters from the DataItemTableView to the OnPreDataItem there’d be no need to use FILTERGROUP since all filters would be in the same group (0). Anyway - it was just a suggestion… [:)]

quote:

Well, if you move the filters from the DataItemTableView to the OnPreDataItem there’d be no need to use FILTERGROUP since all filters would be in the same group (0). Anyway - it was just a suggestion… [:)]
Originally posted by Steffen Voel - 2005 Dec 15 : 10:33:26

And a nice suggestion. I’ve made a mistake in my report. That’s why I thought there had to be more filtergroups… [:I] You’re right. FILTERGROUP(0) would be the only FILTERGROUP. Thanks! [:D]