2012年11月8日星期四

How to using code changed font in AX2012

AX2012 have no setup the font on user options.
So, I write a job update the userId [admin]'s font

static void THK_7519_ChangeUserFont(Args _args)
{
    UserInfo    UserInfo;
    container   con;// #! INCIDENT !#.LAST.07.11.12.JXie7519:
;
    ttsBegin;
    select firstonly forupdate UserInfo
        where UserInfo.id == "admin";

    if(UserInfo)
    {
        UserInfo.propertyFontName   = "Tahoma";
        UserInfo.formFontName       = "Tahoma";
        UserInfo.reportFontName     = "Tahoma";

        UserInfo.doUpdate();

        con = [ "Property : "   + UserInfo.propertyFontName, UserInfo.propertyFontSize,
                "Form : "       + UserInfo.formFontName, UserInfo.formFontSize,
                "Report : "     + UserInfo.reportFontName, UserInfo.reportFontSize];
        info(con2Str(con));
    }
    ttsCommit;
}

没有评论:

发表评论