So you have created this great customization and part of it is to launch a URL and pass in some parameters via http. For example, a customization on the customer master that will open the customer’s invoice entry portal where you can type in the invoice information.
The following code can be placed in the (General) section of your VBA customization and be called from any other event, for example the BeforeUserChanged event.
You can call the ShellExecute() Windows API function from a Visual Basic for Applications in Microsoft Dynamics GP to start another program under Microsoft Windows. Use ShellExecute() instead of Shell (a Visual Basic statement) or WinExec() (a Windows API function) to work around the following limitation of the latter commands: With Shell and WinExec(), you cannot start an application by specifying a file name only. ShellExecute() uses the default programs associated to each file type. In the case of the above example, ShellExecute() automatically recognizes the prefix http in the URL and launches Internet Explorer (or the default browser application).
KB Article 224816 – Use ShellExecute to Launch the default browser, by Microsoft Support.
Until next post!
Mariano Gomez, MIS, MVP, MCP, PMP
Maximum Global Business, LLC