web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Label search in Dynamics AX (AX7)

(0) ShareShare
ReportReport
Posted on by

I am in the process of migrating an AX2012 application to AX7.


The old application made use of the label editor to allow the user to do a text search for label IDs.
I am creating a new "Label Search" form, and I'm trying to actually DO the search.  I've done some research online, and found how several sites say it's done in AX2012.  I'm trying it in AX7, but the search never returns any results.   Here is the code I'm using:

str searchText = LabelSearchEdit.text();
str searchLang = LanguageComboBox.getText(LanguageComboBox.selection());
str currLabelID = null;
List labelIDs = new List(Types::String);
Label lbl = SysLabel::getLabelInstance(searchLang);
     
// Do the work of searching for the label
currLabelID = lbl.searchFirst(searchText);
while (currLabelID != null)
{
    // Add the ID to the list
    labelIDs.addEnd(currLabelID);
    // Search for the next one
    currLabelID = lbl.searchNext();
}


I'm getting proper values from the controls on my form, but the searchFirst() method is always returning an empty string.  Am I missing something, or is this is another one of those APIs that is not deprecated in AX7, but not actually implemented either?

*This post is locked for comments

I have the same question (0)
  • Kevin Kidder Profile Picture
    on at

    Hello Richard - I am not sure about your question here, but why are you not just using the Find Labels menu item under the Dynamics AX menu inside Visual Studio and the Label Search form it opens to search for labels in the new Dynamics AX developer experience?

  • Community Member Profile Picture
    on at

    Because I'm not taking about looking up a label when _developing_ my application.

    I'm talking about doing it _in code_.  In a part of mymy application, users look up labels searching for the text to get the Label ID, which is added to a custom table..  Those label IDs are later used by customized reports.

    The why isn't so important as the HOW, since the clearly defined API isn't working..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans