Change Form language

Dear All,

Need help from you guys to resolve below issue.

I need to chnage the language of FORM based on the language selected by user.

In form i have a language filed, if user chnage value then form should get updated with new language.

Regards,

Rajendra

There are certain limitations as to how far you can get a different language.

Try this out:

  1. In the init() method of the form do something like this:

public void init()
{
super();
infolog.language(“de”); // switch to German
}

  1. In the canclose() method write something like this:

public boolean canClose()
{
boolean ret;

ret = super();
infolog.language(“en-us”); // switch back to whatever the languqage
return ret;
}

It is an easy way and it works. It opens this particular form in the language you have defined in init() method. However here comes the problem - infolog.language() changes the language for the whole user session, therefore, if user opens any other forms in the meantime while he has this form still open, then all the forms will be opened in German as well… there is a way to avoid this problem - you could make this form as a modal form, so that user cannot interact with any other AX functionality unless the current form is closed.

However, a more appropriate way would be to write a code in form init() method that dynamically loops through all the controls in Form and updates all labels with a static text in another chosen lanugage. I mean, you go through all controls, read the current label and find a static text for this label in another language. This would definitely ensure that only the current form has a different language. This would take a bit of a time to implement, however…

Dear Janis,

Thanks a lot. It is a very healthy information and helps me a lot.

Regards,

Rajendra