Filtering a form

xavigepexavigepe Member Posts: 185
I have a form wich uses a table and one of the fields of the table is the Navision's userid of the user who has inserted the record. When I open the form I want it to be filtered by the USERID() (Navision function) of the user who opens it. If I could use the form's sourcetableview property it would be something like : table.userid =USERID(), but it doesn't work. How could I do it?.

Thanks,

Answers

  • babbab Member Posts: 65
    in the OnOpenForm trigger of the form, you can write
    SETRANGE("User ID Field", USERID);
    
    or
    FILTERGROUP(2);
    SETRANGE("User ID Field", USERID);
    FILTERGROUP(0);
    
  • xavigepexavigepe Member Posts: 185
    Thanks so much.
  • babbab Member Posts: 65
    you are welcome
  • krikikriki Member, Moderator Posts: 9,118
    bab wrote:
    FILTERGROUP(2);
    SETRANGE("User ID Field", USERID);
    FILTERGROUP(0);
    
    Better don't use filtergroups 1 to 5, because these are reserved by Navision.
    Use filtergroups starting from group 6 and up.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • babbab Member Posts: 65
    the 2nd level is used by the SorceTableView property, and i never had a problem with using this level.
    but maybe you have right, it's better, if we don't use the "Internal Levels" of the NAV :-#
Sign In or Register to comment.