SETFILTER issue

WashoutWashout Member Posts: 24
my first post....Im new to coding in navision

How do you SETFILTER on a Field type Text if the the String contains special chars like '('


I am trying to Filter as follows

rItem.SETFILTER("Main Title",tDescription)

but i think it is failing because of invald chars in tDescription

I get an error message

The Filter 'ABC (DEF)' is invalid

Comments

  • bbrownbbrown Member Posts: 3,268
    Welcome the world of NAV


    Try this:

    rItem.SETFILTER("Main Title", '%1', tDescription);
    There are no bugs - only undocumented features.
  • WaldoWaldo Member Posts: 3,412
    or:

    rItem.SETRANGE("Main Title", tDescription);

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DaveTDaveT Member Posts: 1,039
    Hi Washout,

    As Eric (Waldo) says setfilter solves this but also I would recommend using SETRANGE over SETFILTER as it is more efficent.

    I only use SETFILTER for wildcards.

    A big Fáilte to Nav and Mibuso :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • WaldoWaldo Member Posts: 3,412
    Fáilte ?

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • DaveTDaveT Member Posts: 1,039
    Hi Eric,

    It's the Irish for Welcome - I know rule.... don't post in foreign language but I couldn't resist - Irish people on Mibuso are a rare breed :D
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.