Skip to main content

Posts

Showing posts with the label language

How to set the language used on a report

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 @SYS12...

Changing the language at runtime in X++

In the setSetup method of the SysUserSetup form within the if clause add the following: if (infolog.language() != userinfo.language) { infolog.language(userinfo.language); infolog.navPane().loadStartupButtons(); }

Changing the language at runtime in X++

We recently had a case where the customer wanted to change the language being used for a given AX user at runtime. The customer had sorted out how to change the language displayed in forms and reports but the buttons on the navigation pane were not getting updated. Here is a way to handle this scenario: In the setSetup method of the SysUserSetup form within the if clause add the following: if (infolog.language() != userinfo.language) { infolog.language(userinfo.language); infolog.navPane().loadStartupButtons(); }