AX / D365FO – Get label text in different languages

To get a label text in a specific language you can use labelId2String() method of the SysLabel class.

If you avoid to specify the language the method will use the default system Language

SysLabel::labelId2String(literalstr('@SYS1'), 'en-us'); //will show "Time transactions"

SysLabel::labelId2String(literalstr('@SYS1'), 'it'); //will show "Transazioni temporali"

One response to “AX / D365FO – Get label text in different languages”

  1. Sourav Avatar
    Sourav

    Thanks for the info.

    I need a language in both English and Portuguese. I have created a label in EN-US and used the same label in both places. As you suggested.

    But it’s return’s the label in En-us for both. i.e Bank Transfer

    I expected to get

    Bank Transfer = Transferência bancária 

    Is I need to create a one more label for Portuguese?

    Kindly elaborate please ASAP.

    It’s urgent.

    Thanks in advance!

    Like

Leave a comment