Friday, January 13, 2012

AX SSRS: Use AX Label with localization

To use AX label with localization, you can wrap SysLabel::labelId2String static method or SysLabel::labelId2String2 static method in a data method and call it in the design:

[DataMethod(), AxSessionPermission(SecurityAction.Assert)]
public static String GetLabel(String labelId, String languageId)
{
    return SessionManager.GetSession().CallStaticClassMethod(
                          "SysLabel", "labelId2String2", labelId, languageId);
}


and use it: =GetLabel("@SYS103105", User!Language)