Question Launching a web browser via QAD

robgschoenfeld

New Member
I've spent weeks trying to figure this out with no success. New to progress abl and looking for a way to launch browser event or embed IE from with in the QAD client. Our back end and app server are Linux based. We've reached out to resources at Bravepoint and QAD with definitive direction. I've reviewed documentation involving OS-Command Functions and the .net ui layer. I'm not looking for anyone to write my code just point me in the right direction. Any assistance would be greatly appreciated.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
One way to do it in Windows is to instantiate a web browser via COM automation.

The basic idea:
Code:
define variable chIE as com-handle no-undo.
create "InternetExplorer.Application" chIE.
chIE:Visible = TRUE.
chIE:Navigate(" /* URL goes here... */ ").
...etc...

Remember to RELEASE what you CREATE.
 

robgschoenfeld

New Member
So your code works like a charm when I compile progress locally. However I see a two second delay and no action on from my QAD Trigger. We are running OpenEdge 10.2b and 2012EE. It almost looks like the QAD thick client can't make the OS call. Is there some sort if security setting on the QAD client side that might block this interaction?

Thanks for the help on the code.

define variable chIE as com-handle no-undo.
create "InternetExplorer.Application" chIE.
chIE:Visible = TRUE.
chIE:Navigate("URL").
RELEASE OBJECT chIE.
 

Courtney White

New Member
I've taken over this project from Rob.

After doing some investigating, I think I've determined that everything Progress is run on the QAD server, so there is no way to directly launch a Windows application using a progress program.

I think the solution is going to be one of the following:
1. Have the QAD unix server send a windows command over the network to the users computer, which launches a browser. All of the users are using a citrix desktop, so the computer is already known, and we'd just have to determine the user id.
2. Write a Windows program that sits on the users computer, and listens to the QAD unix server. When it sees a task for the user, it launches IE.

Any thoughts on this would be appreciated.
 

Courtney White

New Member
Here is the VBSscript I've come up with. Since the server is Linux, I will launch it using WINE and the OS-COMMAND progress function.

Our users use the same UserID for QAD and Windows, so using the usr_mstr.usr_userID field, we can pass that as the first argument.

In our case, the server the users are running on is static, but we could also use a custom field in usr_mstr to hold the user's machine name. That gets passed as argument 2.

Lastly, we're going to try and launch a intranet site, including a record number, so that our users can fill out a web form tied to the QAD record in our document control system.

This script uses PSexec, so make sure to put it in the folder you have the script in.

so, the following:
Code:
cscript IERemoteLauncher.vbs USER SERVER WEBSITE
Find the session of the user on the server, and launch the website in an IE window on their session.

Here is the script.
Code:
'IERemoteLauncher.vbs

Set args = WScript.Arguments
SIDQuery = "query session "&args.Item(0)&" /Server "&args.Item(1)

Set oShell = CreateObject ("WScript.Shell")
Set oExec = oShell.Exec(SIDQuery)
Do While oExec.Status = 0
  WScript.Sleep 5
Loop
myArray = Split(oExec.StdOut.ReadAll, vbCrLf)

SessionID = Mid(myArray(1),45,3)

LaunchString = "psexec -s -d -i "&SessionID&" \\"&args.Item(1)&" iexplore.exe """&args.Item(2)&""""
oShell.Exec(LaunchString)
'END
 
Top