Knowledge Base Article

> Knowledge Base > Rapise > Rapise Desktop

Created By  dmarkovtsev Thursday, January 11, 2018

Check that Dynamics NAV client is installed on a machine and launch it if it is not started yet with this simple function.

function LaunchDynamicsNAV()
{
    var pfFolder = Global.GetSpecialFolderPath("ProgramFilesX86");
    var dynamicsPath = pfFolder + "\\Microsoft Dynamics NAV\\100\\RoleTailored Client\\Microsoft.Dynamics.Nav.Client.exe";

    if (!Tester.Assert("Dynamics NAV Client is installed", File.Exists(dynamicsPath)))
    {
        return false;
    }
    
    var windows = g_util.FindWindows("regex:.*Microsoft Dynamics NAV", "regex:WindowsForms10.*");
    var pid = 1;
    if (windows.length == 0)
    {
        Tester.Message("Dynamics NAV Client is not started. Launching...");
        pid = Global.DoLaunch(dynamicsPath);
    }
    
    if (!Tester.Assert("Dynamics NAV Client is running", pid > 0))
    {
        return false;
    }
    
    return true;
}

 

Article Info
  • Last Updated: 1/11/2018
  • Article ID: KB314
  • Views: 267