Monday 3 August 2015

How to get Label Id from a text in AX 2012

How to get Label Id from a text in Ax 2012

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              txt= "Customer account";
   str              CharsTxt;
    
   CharsTxt = SysLabel::searchStringBuildSpecialCharString(txt);    
   CharsTxt = SysLabel::seachStringBuildExactStr(CharsTxt);
    
   labelid = sysLabelEdit.findLabel("en-us", CharsTxt);
    
   info ( labelid );
















Thank You!

1 comment:

  1. How to find out all labelids of "Customer account"; text

    ReplyDelete

Import General journal from excel in D365 F&O

 Hi Guys, Import General journal from excel in D365 F&O Code:  using System.IO; using OfficeOpenXml; using OfficeOpenXml.ExcelPackage; u...