Thursday, June 8, 2017

How to change user font

static void tmxSetUserFont(Args _args)
{
    #define.fontName('Arial')
    #define.fontSize(8)
    UserInfo userInfo;

    select forUpdate userInfo
        where userInfo.id == curUserId();
    if(userInfo)
    {
        ttsBegin;
        userInfo.formFontName = #fontName;
        userInfo.formFontSize = #fontSize;
        userInfo.update();
        info(strFmt("New user '%3' font set to '%1' of '%2' size", userInfo.formFontName, userInfo.formFontSize, userInfo.id));
        ttsCommit;
    }
    else
    {
        error(strFmt("User '%1' not found!", curUserId()));
    }

}

No comments: