Opening a Form after Logging into Microsoft Dynamics GP

David MeegoAs a follow on from the post last week on capturing the logging in and logging out events in Microsoft Dynamics GP, I want to cover how to open a form after logging into Microsoft Dynamics GP.  This could be a hidden form used by your code or a window that you want to open automatically.

Please refer to the previous post for the underlying scripts:

Running Dexterity scripts after Login or before Logout

After Logging in, the system runs a number of processes in the background, such as the script which hides menu entries that a user does not have security access to.

We want our window to open after all the background processing is completed, so we need to use call background to add our command into the background queue.

Updated Set_Environment_Sub Global Procedure

 { Code to be run on login and returning from Report Writer/Modifier }

{ Put your code below here }
call background MBS_Open_Form;

{ Put your code above here }

MBS_Open_Form Global Procedure

 { Open form in Background }
open form <Name of Form here>;

Note: If this is for a hidden form, make sure that it has at least a main window (first window in list) on it which the following properties set. AutoOpen=False, Title=~internal~ .  Otherwise, the hidden form will fail to open under the version 10.0 (and later) pessimistic security model. 

David