How to open client monitor automatically and small bug

pmusupmusu Member Posts: 55
Hi,

I am creating a script in a Navision codeunit (1) to open and run the Client Monitor.

The Client Monitor is opening correctly but it is not starting.

The following is what I have up till now.

Global Variable:
Name	DataType	Subtype	Length
wshShell	Automation	'Windows Script Host Object Model'.WshShell

Code:

IF ISCLEAR(wshShell) THEN
  CREATE(wshShell); //Instantiate object
wshShell.SendKeys('%{T}'); //Open tools menu
wshShell.SendKeys('m'); //Open client monitor
///wshShell.SendKeys('ENTER');
wshShell.SendKeys('{ENTER}'); //Run code coverage.

The client monitor screen open correctly. However the start button is not being 'pushed'.

Any ideas?
Thanks in advance

Comments

  • DenSterDenSter Member Posts: 8,304
    Automatically starting client monitor for all users will cause severe performance problems.
  • pmusupmusu Member Posts: 55
    DenSter wrote:
    Automatically starting client monitor for all users will cause severe performance problems.

    Thanks for the reply.
    I understand your concern. However in this case it is a testing environment (before going live).
    They are encountering some problems and require the client monitor so that they could pinpoint bottlenecks in the system.
  • BeliasBelias Member Posts: 2,998
    maybe you need a sleep between "m" keypress and "enter" keypress...
    remember that after filling 2GB of ClientMonitor, nav crashes
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • pmusupmusu Member Posts: 55
    Belias wrote:
    maybe you need a sleep between "m" keypress and "enter" keypress...
    remember that after filling 2GB of ClientMonitor, nav crashes

    Thanks for informing me about the 2GB limit.
    I have tried using the timer automation.
    I am probably missing something extremely simple.
    When I try to run the code I am getting the following error message:

    Microsoft Business Solutions-Navision
    Not an allowed option.

    OK

    I declared the following global variable:
    Name	DataType	Subtype	Length
    Timerx	Automation	'Navision Timer 1.0'.Timer
    


    IF ISCLEAR(wshShell) THEN
      CREATE(wshShell); //Instantiate object
    
    IF ISCLEAR(Timerx) THEN
      CREATE(Timerx);
    
    Timerx.Interval(100);
    Timerx.Enabled(TRUE);
    
    
    wshShell.SendKeys('%{T}'); //Open tools menu
    wshShell.SendKeys('m'); //Open client monitor
    Timerx::Timer(Milliseconds : Integer) //Getting error
    wshShell.SendKeys('{ENTER}');
    wshShell.SendKeys('{ENTER}'); //Run code coverage.
    
    
    //wshShell.SendKeys('{ENTER}'); //Run code coverage.
    //wshShell.SendKeys('{ENTER}'); //Run code coverage.
    ///wshShell.SendKeys('ENTER');
    

    Thanks
  • BeliasBelias Member Posts: 2,998
    maybe i've been misunderstood, i was not joking when talking about SLEEP
    use this
    sendkey m
    sleep(1000)
    sendkey enter
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • DenSterDenSter Member Posts: 8,304
    pmusu wrote:
    I understand your concern. However in this case it is a testing environment (before going live).
    They are encountering some problems and require the client monitor so that they could pinpoint bottlenecks in the system.
    The client monitor will CAUSE a bottleneck, to use it like that is going to ive you problems that would not occur if you hadn't had client monitor running. You should only run it for a particular task when you find a problem.
  • garakgarak Member Posts: 3,263
    why do you need to open the CM for every person (CU1)?
    Is it only for tests and you will see which source are executed for testing your application?
    David is right, the CM will CAUSE a bottleneck ....

    So, whats the reason why you will use it. Normally the CM will be used to find a bug or a codesnippes where a bug is presumed
    Do you make it right, it works too!
Sign In or Register to comment.