0

Is it possible to do a case sensitive find (search) in Dynamics AX 2009?

For example, when I am searching for "address", I don't want to see "Address" in the results.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
Michael Russ
  • 81
  • 3
  • 10

3 Answers3

0

If you have a look at the Find form window that appears when you do a find, look at the properties, this helps you narrow you down your search, unsure about a like-for-like exact match i.e. "address" and blocking out "Address".

will
  • 188
  • 1
  • 4
  • 16
0

No you cannot.

As mentioned in this answer, the find form uses the match method, which is documented on msdn here.

To quote MSDN;

Remarks

The system does not differentiate between lower and upper case.

Community
  • 1
  • 1
AnthonyBlake
  • 2,334
  • 1
  • 25
  • 39
0

Jan,

There IS a way to do it using standard Axapta X++. When you use the find screen there is a tab called 'Filter' where you can place code to do the filtering (no need to complete the fields on the name & location tab). The below code is for illustration purposes only as the below code is not complete and has not been finalised (I leave that to you).

str             toMatch     = 'Address';
str             string;
str             char, charMatch;
int             i, pos;
boolean         ret;
;

pos     = strScan(_treeNodeName, toMatch, 1, strLen(_treeNodeName));
string  = subStr(_treeNodeName, pos, strLen(toMatch));
if (string)
{
    ret             = true;
    for (i=1;i<=strLen(toMatch);i++)
    {
        char        = subStr(toMatch, i, 1);
        charMatch   = subStr(string, i, 1);
        if (char2num(char,1) != char2num(charMatch,1))
        {
            ret     = false;
        }
    }
    if (ret)
    {
        return ret;
    }
}

pos     = strScan(_treeNodeSource, toMatch, 1, strLen(_treeNodeSource));
string  = subStr(_treeNodeSource, pos, strLen(toMatch));
if (string)
{
    ret             = true;
    for (i=1;i<=strLen(toMatch);i++)
    {
        char        = subStr(toMatch, i, 1);
        charMatch   = subStr(string, i, 1);
        if (char2num(char,1) != char2num(charMatch,1))
        {
            ret     = false;
        }
    }
    if (ret)
    {
        return ret;
    }
}
return false;
Barry Bayliss
  • 44
  • 1
  • 3
  • I haven't tried this, but it sounds plausible. Thanks for the code to get me started. I wonder what kind of of effect on performance the filter will have? – Michael Russ Mar 13 '13 at 19:52