Options

How to call up the TABLEFILTER (ctrl+F7) by code

navcoinavcoi Member Posts: 3
Anyone know how I can bring up the table filter dialog that you get when you press Ctrl+F7 from my code.

A client would like to be able to pick an item from the Sales Header table, but at the time is unsure which one or how to filter it. They can filter it on any field existing in the sales header table. I can bring up the Sales Header table and so far all I can do is try to replicate the CTRL+F7 code which seems a bit like too much duplication. I would then like to bring up the Filter dialog instead to allow them filter their selection.

The Table Filter Form you get with Navision by pressing (CTRL+F7) is exactly what I want, since it allows them to add as many of the fields and apply it. But so far I've not been able to find anything to say how to call up this filter automatically.

Is their a command I can run from my code to bring up this Table Filter without requiring the user to have to press the CTRL+F7?

Thanks

Comments

  • Options
    ajhvdbajhvdb Member Posts: 672
    Search for sendkey on this forum
  • Options
    SLF25SLF25 Member Posts: 37
    I can only give you an advice that you should educate your users to use filters the standard way (+ using right key), or else you will have problems when your database grows. Using filters in Navision is a basic requirement for Navision user.
  • Options
    jreynoldsjreynolds Member Posts: 175
    You can define a report with Sales Header as the dataitem, run the report from your code; the report does not print anything or do any processing but you can retrieve the filters that have been set by the user. It's not quite the same as the table filter from available form available via Ctrl+F7 but it accomplishes the same thing.
  • Options
    ramad78ramad78 Member Posts: 1
    You can use this code:

    IF ISCLEAR(WShell) THEN IF NOT CREATE(WShell) THEN EXIT;
    WShell.SendKeys('^{F7}');

    And have WShell declared as a variable of Automation of type 'Windows Script Host Object Model'.WshShell.
  • Options
    navcoinavcoi Member Posts: 3
    ramad-- thanks thats exactly what I wanted. Table comes up with the filter directly over it..
Sign In or Register to comment.