Execute Client code on application startup in Dynamics AX 2009

question
I want to execute some client code on application startup. Where should I place this code?

-->
answer

Modify \Classes\Info\startupPost() method for Axapta 3.0 or
\Classes\Info\workspaceWindowCreated() for AX 4.0 and AX 2009.
workspaceWindowCreated

 

such as
AOT - > Classes - > Info - >  workspaceWindowCreated()
void workspaceWindowCreated(int _hWnd)
{
    /**
        Put workspace window specific initialization here.
     -- Description: Show profile-name in the title bar
     Remark by Jimmy 2010-09-06
    */
    session     s = new Session();
    SysUserLog  SysUserLog;
    Str 25      IPAdress;
;

    IPAdress = SysUserLog::IPAdress(S.sessionId());
    ttsbegin;

    select firstonly forupdate SysUserLog
        order by SysUserLog.RecId desc
        where SysUserLog.UserId     == curuserid()
           && SysUserLog.SessionId  == s.sessionId();
    if(SysUserLog)
    {
        SysUserLog.IPAdress = IPAdress;
        SysUserLog.update();
    }
    ttscommit;

    WinAPI::setWindowText(_hWnd, strFmt("%1 - %2 - %3",
                          //xInfo::configuration(),
                          WinAPI::getWindowText(_hWnd),
                          IPAdress,
                          s.userId())
                          );

}

posted @ 2010-09-06 16:02  Fandy Xie  Views(494)  Comments(0Edit  收藏  举报