Is there a way to pre-set the field list in a Table Filter?

KAdamsInCo
KAdamsInCo Member Posts: 28
Our clients need to look up contacts on a very regualr basis throughout the day, and they normally search on the same fields over and over again. Fields would include Contact Number, Name, Postal (Zip) Code, etc. They need to be able to filter on more than one field in most cases, so a table filter is used frequently.

The trouble is, the only field that appears in the table filter list is the field their cursor is currently on in the form. Is there a way to pre-populate for a table (or form), when the user selects the Table Filter (Ctrl+F7), a list of fields in the filter box so they don't have to select the fields over and over again?

The goal would be to have them enter only the search parameters that they want to filter on and not have to pick the actual fields to filter on from the field list lookup form.

I have tried some things with SETFILTER at the table level with no luck. Any suggestions are greatly appreciated.

Thanks,

Keaton ](*,)

Comments

  • ara3n
    ara3n Member Posts: 9,258
    Hello Keaton, you can modify the form, and on top of the form add new text boxes that will act like filters. Take a look at budgets form for example and you'll get the idea.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • KAdamsInCo
    KAdamsInCo Member Posts: 28
    I did look at the Budget form and duplicated the filter field idea. It works very well. Thanks for helping me 'think outside of the box'. :D

    -Keaton
  • couberpu
    couberpu Member Posts: 317
    ara3n wrote:
    Hello Keaton, you can modify the form, and on top of the form add new text boxes that will act like filters. Take a look at budgets form for example and you'll get the idea.

    Hi ara3n,

    Can you point out another example besides budgets form? I do not have license to read budgets form and I really like to learn on how to do it!
    Here is the thing: My boss like to add/change information on forms constantly and each time I made the change it resets the layout of the form. If I can control showing/not showing and sequence of the layout of fields, I do not need/have to answer 10~20 phone calls on why their screen was changed!

    Thank you, thank you and thank you! :wink::wink:

    CouberPu
  • David_Singleton
    David_Singleton Member Posts: 5,479
    KAdamsInCo wrote:
    ...
    I have tried some things with SETFILTER at the table level with no luck. Any suggestions are greatly appreciated.
    ...

    You need to do it at the form level, not table.

    Add the following code to the Contact Form
    _OnOpenForm_
    
    setfilter(Name,'%1','*');
    setfilter(Address,'%1','*');
    Setfilter("Post Code",'%1','*');
    

    Then when you use Shift+F7 it will show the fields you want. But even though this is what you asked for, I think Ahmed's suggestion is better. That also has the advantage that you can optimize it by putting in SETCURRENTKEY depending on what they filter by.
    David Singleton
  • ara3n
    ara3n Member Posts: 9,258
    KAdamsInCo wrote:
    I did look at the Budget form and duplicated the filter field idea. It works very well. Thanks for helping me 'think outside of the box'. :D

    -Keaton

    You are welcome.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3n
    ara3n Member Posts: 9,258
    couberpu wrote:
    ara3n wrote:
    Hello Keaton, you can modify the form, and on top of the form add new text boxes that will act like filters. Take a look at budgets form for example and you'll get the idea.

    Hi ara3n,

    Can you point out another example besides budgets form? I do not have license to read budgets form and I really like to learn on how to do it!
    Here is the thing: My boss like to add/change information on forms constantly and each time I made the change it resets the layout of the form. If I can control showing/not showing and sequence of the layout of fields, I do not need/have to answer 10~20 phone calls on why their screen was changed!

    Thank you, thank you and thank you! :wink::wink:

    CouberPu


    As far as form layout goes, talk to your boss and see how he has setup his form. then design the form and move the fields the way he wants it in the design form. Also fields that he doesn't want to see, you can click on properties and set visible to no. That way by default they will not appear.

    I also Like David's idea.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • couberpu
    couberpu Member Posts: 317
    So there is no way of controlling form layout based on userid, meaning one form has different field layouts based on user name. ](*,)

    Thanks,
    CouberPu :!:
  • David_Singleton
    David_Singleton Member Posts: 5,479
    couberpu wrote:
    So there is no way of controlling form layout based on userid, meaning one form has different field layouts based on user name. ](*,)

    Thanks,
    CouberPu :!:

    That's a yes and no type thing. Standard in the current version of Navision its not possible, but you can do it in code. For a good example of this, look at the main menu (form330) in version 3.70. Here the layout changes according to user permissions. This same principle can be used on any form, but its not simple, and requires a lot of development time.

    Its generally a better solution to create user groups, and create different forms for those users depending on their role. If you want to hide and show fields for users, then there are some add-ons out there that handle this quite well.
    David Singleton
  • couberpu
    couberpu Member Posts: 317
    Thanks to Ya ALL!

    My thing is the ZUP file. Once the zup file has a disagreement with the database object, it either "do nothing" or "screw me up". If I touched a form, without any change, and compile it. The screen layout got reset next time they use the form. People at work here like to have their own screen layout, a strong selling point initially, and I like to keep that for the people here. Come to think of it, what I really need is a way to have ZUP file work with me to get users' screen layout. Is this too much to ask?

    Have a nice weekend,
    CouberPu
  • ara3n
    ara3n Member Posts: 9,258
    well, you can stop constantly making changes to the forms. :mrgreen:
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n