KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Troubleshooting LAUNCH EXTERNAL PROCESS
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: March 19, 2024

The LAUNCH EXTERNAL PROCESS (LEP for brevity) command is a useful feature to allow 4D to interact with external features. However, because these features are external it may not be as straightforward to debug when an issue occurs. This can be difficult due to 4D automatically closing the process when it completes.

When using the LEP command, the command is sent as a command line to the system. If the LEP fails to run as expected, there are a couple of ways to troubleshoot the issue.

The first step should be to manually run the command from the command-line shell. In Windows, this is the Command Prompt and in MacOS this is the Terminal. The command should be run similarly to how 4D is calling it, with the same pathing and such. If the command fails, a message may display to provide some insight or it can be something with the items script or application being executed.

Another thing to check should be if the issue is related to privileges. Some items will only run if the user has permission to run the command. Windows allows applications to be run as an Administrator. If the command works after running the command from an elevated user this is the issue.

The LEP command also has some outputs. The third and fourth parameters will contain the output stream (stdout) and error stream (strerr) respectively. These results should be the same as calling the command manually. If the results are different then the results may provide more insight into the issue.

When using the LEP command 4D will pass the command to the command-line. If there are issues it is best to investigate the command being passed with the command-line shell, as the application will remain open instead of automatically closing.