Friday, March 14, 2014

How to get Label Id from a text

Hi All

If you want retrieve the Label ID from a specific text description, here the code.
If are present more Label ID for a specific text, you will have the first.

   sysLabelEdit     sysLabelEdit = New sysLabelEdit();
   labelid          labelid;
   str              text = "Customer account";
   str              specialCharsText;
   
   specialCharsText = SysLabel::searchStringBuildSpecialCharString(text);   
   specialCharsText = SysLabel::seachStringBuildExactStr(specialCharsText);
   
   labelid = sysLabelEdit.findLabel("en-us", specialCharsText);
   
   info ( labelid );

That's all!

 

No comments: