Send Alt+Tab from Navision

lagersjeflagersjef Member Posts: 57
Hi,

I wonder if anyone has any expoerience with sending Alt+Tab from a button in Navision.

we have multiple applications running on the POS, but would like to switch between Navision and a web browser. The user should be able to switch from Navision to the web browser by pushing a button on the screen.

So, switching to the next application is one challenge, but maybe bigger is switching to the right one (IE) in one click...

I know I can trigger Internet Explorer and pass it a URL through a shell command, but if I use that every time, I would end up with a ton of IE sessions.

Any ideas?

Comments

  • DenSterDenSter Member Posts: 8,307
    Actually when you click a button with a hyperlink to the same URL, it does not open a new browser window.

    In OnPush of the button:
    HYPERLINK('http://www.cnn.com/');
    
    Click it and it opens IE on cnn. Go back to Navision, click it again and it will go right back to the one that's already open.
  • ara3nara3n Member Posts: 9,257
    You can use the following code

    wscript Automation Windows Script Host Object Model'.WshShell";
    IF ISCLEAR(wscript) THEN
      CREATE(wscript); 
    
    wscript.SendKeys('%{TAB}');
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    Which doesn't necessarily switch over to the web browser, if that is not the last app before working in Navision. Plus it requires you to add an automation variable, and it only works on time from Navision. Putting a HYPERLINK command with a web URL does not need any registration of components or any additional variables, it just assumes that the current machine has a default web browser installed.
  • ara3nara3n Member Posts: 9,257
    THe hyperlink will now work either if the user visits a different page. So if the address bar on IE is different, IE will open a new window.

    I simply told him what he wanted to know in the first place.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    I'm sure you could also use the IE object model as an automation server in C/AL code, although I have not tried that myself.
Sign In or Register to comment.