Site icon DAXRunBase

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:

void clicked()
{
    ;

    element.labelSearch(searchString.text(), 
                        FormControlExactMatch.value());
    super();

}

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

Exit mobile version