Skip to main content

Posts

Showing posts with the label lable

Export and import Dynamics Ax labels

static void ExportLabels(Args _args) { str module = "TUS"; str exportFile = "\\\\tsclient\\c\\fil1.txt"; Label l; str s; int i; System.IO.TextWriter tw; ; l = new Label(); i = 0; tw = new System.IO.StreamWriter(exportFile); while(i < 9999) { s = l.extractString("@" + module + int2str(i)); if(substr(s,1,1) != '@') tw.WriteLine("@" + module + int2str(i) + ";" + s); i++; } tw.Close(); } static void ImportLabels(Args _args) { str module = "TUS"; str importFile = "\\\\tsclient\\c\\fil2.txt"; Label l; str s; System.IO.TextReader tw; System.String ss; str labelid, labeltext; int i; str existingLabel; ; l = new Label(); tw = new System.IO.StreamReader(importFile); ss = tw.ReadLine(); while(ss) { s = ss; i = strScan(s, ";", 1, 10); ...

Getting label text in different languages

When printing a report, Ax sets the used language automatically based on the user's settings. The selection of available languages for the client interface depends on the installed language license keys. But sometimes, it may be necessary to change the default settings for reports. With reports needed for external use for example. Like invoices and packings slips you send to your customers. These documents require to be made up in the language of your customer. Ax is designed with this scenario in mind. The language to use in the report can be set with following command: element.design().languageID(); So for example: element.design().languageID('en-us'); Place the code in the init method of your report, or in the fetch method. You can use this in your own custom reports as well, with no limitation regarding the language license keys you bought. All you need are the appropriate label files. (Otherwise you get error messages like 'label @SYS1...

Finding unused labels in Dynamics Ax 2009

The pain of unused labels is felt when you start translating your application to support the global versions. As we were porting our application to German we were seeing every possible way to speed up the translation work, one of it was to avoid translating unused labels.  So we tried a few tools that helps us identify this but unfortunately nothing turned helpful. We then resorted to invent our own strategy …. I’m just reposting what my colleague had already posted on his blog with little more detail and a few additions … *This job works only if your cross reference is updated* static void FindUnUsedLabels() {     str 50          labelId;     str             labelString;     int             i;     //set max label to the highest number of labelId in you...

Delete one of the lable files

You need to find your AX AOS install directory. Usually C:\Program Files\Microsoft Dynamics AX\50\Application\Appl\[Instance Name]. From this directory, if your label file is LBL in AX: Stop the AOS Delete all of the axLBL*.ald, axLBL*.alc, axLBL*.ali files Start the AOS The ALD files are "Application Label Data", ALC files are "Application Label Cache", and the ALI files are "Application Label Index" files. When you create a new label, say @LBL123, it will often store it in the ALC file until at some point AX decides to flush it from the cache file into the ALD file. When you stop the AOS, it flushes these for you, and you can do it manually in AX too (Label::Flush("LBL", "en-us"). The part right after axLBL[here].ald, is the language for the label file. English label files for example are: axLBLen-us.ald axLBLen-us.alc axLBLen-us.ali