Check Filter-String

new_to_calnew_to_cal Member Posts: 21
Hi folks!

In a form I recently designed a user shall enter a filterstring for further processing. The string will be used in a SETFILTER-command. Is there an way I can check whether the filterstring is valid an not somthing like '><*XYZ|' - but preferably on the OnValidate of the field in the form?

Comments

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Why not just let the user to filter on the field itself? If you use Field Filter (F7) or Table Filter (Ctrl+F7) then the system checks on the fly if the filter is valid.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • new_to_calnew_to_cal Member Posts: 21
    Because the filter is used in a codeunit...
  • kitikkitik Member Posts: 230
    Let the user enter the filter in the field.

    If needed somwhere else in the code, use this code to get the filter
    FilterText := Table.GETFILTER(Field);
    

    Salut!
    Laura Nicolàs
    Author of the book Implementing Dynamics NAV 2013
    Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.
Sign In or Register to comment.