Label search with an exact match

If you are trying to look up a label under the menu Tools/Development tools/Label/Label editor, the search string matches your label string with a wildcard.

For search strings like “item” it might display many hits, and takes a lot of time to get the results. But if you enter the label on an object property and you do the lookup there, an exact match search is executed.

If you take a look on \AOTClassesSysLabel::searchStringBuildExactStr(LabelType _searchString) you can find the solution there as a macro.

If you use the same search term, then you will get an exact match:
“<item>”

The next step is implementing a switch in the Label editor. Under \AOTFormsSysLabelSearch create a checkbox for switching the exact match value (formControlExactMatch),
then change the FindNow::clicked() method on the button to the following:

Now you are able to switch getting an exact phrase, or get the default way of using search wildcards.

DAXRunBase / 2010-04-14 / Microsoft Dynamics AX
Tags: , , , ,

Comments

  1. Kevin DeVoe - 2015-10-03 @ 19:47

    You could also use regular expressions. So ^Item$ would work fine.

    Reply
  2. Roger - 2018-05-14 @ 13:29

    what about using quotes in the search like “Purchase Status”? Do the same and no need to customize.

    Reply
    • DAXRunBase - 2018-06-29 @ 07:16

      You can use quotes within the label, so that is not really a solution.

      Reply

Leave a Reply

Your email address will not be published / Required fields are marked *