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)

2 comments:

  1. Dear,

    Can please suggest me any other technique if you dont mind, because above logic was optimum for the version earlier to AX 2012 R2. whereas its not working for later versions.
    So can you help me in this regards,

    Regards,
    Mohamed Alfasith Ismail
    mdalfasith.erp@gmail.com

    ReplyDelete
  2. FYI this sollution It's for Dynamics ax 2009 SSRS extensions. It's not valid for AX2012

    ReplyDelete