Hi Navision people I have a strange problem with the ‘Show All’ button. I have created a custom form that displays Sales Orders (headers and lines). Is similar to the Sales Order form with the difference that my form displays the header in a Tabular-Type form. At the top of this form I am using several filters to filter on the sales header. Also there is an ‘Apply Filters’ button such that when it is pressed it applies the filters (taking the values of the fields at the top of the form). Everything works fine. When I was testing on my form I’ve discovered that when I press the ‘Show All’ button from the Navision toolbar then it displays all the records from the Sales Header table (i.e. all document types). This form is used to display only sales orders. If I press the ‘Show All’ button before I press my custom ‘Apply Filters’ button nothing happens (as expected). The problem occurs after I press my ‘Apply Filters’ button. The trigger code on my button is looks like: onPush() //Reset the rec variable so to remove any filter RESET; //Set record view to sort the record and filter it to ensure that only sales orders are displayed. SETVIEW(‘SORTING(Document Type,Sell-to Customer No.,No.) ORDER(Ascending) WHERE(Document Type=FILTER(Order))’); //Follows some code that does the filtering on the header using SETFILTER and SETRANGE …. …. //Update the form CurrForm.UPDATE; CurrForm.UPDATECONTROLS; Also I’ve set the ‘Source Table View’ property of the form to ‘WHERE(Document Type=FILTER(Order))’. I know that something happens when I press my ‘Apply Filters’ button that causes the ‘Show All’ button to display all document types, but I can’t figure out what happens. Can anybody give me a reason why this happens? How can I solve this? I don’t want to allow the users to display ‘Document Type’ other than ‘Order’. Thanks for your time. Pavlos
The SourceTableView property sets a filter in FilterGroup 2. When you issue the RESET command, this filter is removed therefore exposing all records in the SourceTable.
Thanx Alberto, I’ve manage to solve this (thanks to your help) by adding the line FILTERGROUP(2); just after the SETVIEW in the onPush() trigger.