·
1 min read

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();
        }

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!