Page 1 of 1
pui.runPCCommand question
Posted: Fri Apr 06, 2018 12:09 pm
by mcorbo
Is it possible, prior to running pui.runPCCommand to determine if the PC Command listener is running on the PC? I would like to notify the user that they need to have it installed and/or running if they want to access a certain function where I open an Excel file from the IFS.
Re: pui.runPCCommand question
Posted: Fri Apr 06, 2018 4:15 pm
by Megan
Hello Michael,
This is currently not possible. Normally, a try/catch could be used here, but, since our code already catches the error, this will not work. If you would like to submit a feature request for this functionality, please email us at
support@profoundlogic.com so that we may create one for you.
Thanks,
Re: pui.runPCCommand question
Posted: Fri Apr 06, 2018 4:28 pm
by Scott Klement
There is no actual way to check if the listener is installed, only if an error has occurred. This is because code running in the browser is not allowed to interact directly with the PC operating system (it would be a huge security problem if it could). You'd need an actual program running on the PC to check that (and then you'd need a way to check if *it* was installed... chicken and egg scenario)
try/catch does not make sense, here... this makes an AJAX call, which runs asynchronously in the background. (The error would not occur as your call to pui.runPCCommand is happening.)
What could be done if you wanted to place a feature request would be to have a callback routine that runs when the command has completed that would indicate success or failure. This would be a departure from the current design, however, since it is meant to be like the STRPCCMD CL command, which has no way to detect success/fail. If it failed, you could "assume" (perhaps incorrectly) that this was because the PC Command listener isn't installed, you could phrase it something like "Command Failed -- make sure you have the listener installed" or something like that.
To place a feature request, contact
support@Profoundlogic.com