Páginas

Criar um info ao iniciar o Dynamics AX

Para criarmos um infolog ao iniciarmos o AX basta alterar o método workspaceWindowCreated da classe Info.

Um exemplo, para obter o kernel:
  1. void workspaceWindowCreated(int _hWnd)
  2. {
  3.     // Put workspace window specific initialization here.
  4.     UserInfo userInfo;
  5.     str kernelVersion;
  6.     str applicationVersion;
  7.     str hotfixVersion;
  8.     ;
  9.  
  10.     kernelVersion = xInfo::releaseVersion() + '.' + this.getKernelBuildNo();
  11.     WinAPI::SetWindowText(_hWnd, strFmt("%1 - %2",WinAPI::getWindowText(_hWnd), xInfo::configuration()));
  12.  
  13.     ApplicationVersion = ApplicationVersion::buildNo();
  14.  
  15.     if(ApplicationVersion::GLSAppl()!='')
  16.     {
  17.         applicationVersion += ApplicationVersion::GLSAppl();
  18.     }
  19.     info(strfmt("%1 - %2 %3/ %4 %5", "Kernel", "Esperado:", "5.0.1500.1330", "Obtido:", kernelVersion));
  20.     info(strfmt("%1 - %2 %3/ %4 %5", "Application", "Esperado:", "5.0.1500.1313", "Obtido:", applicationVersion, hotfixVersion));
  21.  
  22.     select firstonly AutoLogOff
  23.         from userInfo
  24.             where userInfo.Id == curuserid();
  25.  
  26.     if (userInfo && userInfo.AutoLogOff)
  27.         this.setTimeOut(identifierstr(autologoff), userInfo.AutoLogOff*1000*60, true);
  28.  
  29.     this.setTimeOut(identifierstr(watchDog), #watchdogInterval, false);
  30. }

O resultado é o seguinte:
 
 
[]'s
Alexssander

Nenhum comentário:

Postar um comentário