Testing for Forms

Does anybody know of a way to test to see if a particular form is open. i wish to stop a user from opening up more than one instance of a form. The form is a clock that will continuously run in the background, so cannot be run modally. Regards, Farhan

I don’t think there is an easy way of testing for a form being open that is available to a developer. However, Navision seems to be able to determine whether or not the Main Menu for is open when you press F12 or click the Menu Menu icon on the toolbar, and likewise with the Object Designer. One option would be to modify the Main Menu to include the clock, or to have the main menu automatically start the clock form. This would limit the ways that the clock could be started. Making it part of the Main Menu form would further allow the user to bring the clock to the front by pressing F12. Another option would be to use a table to determine if the current user in the current session has started the clock form since the current login time. The clock form would have to manage the table, creating and deleting records as the clock form is run and stopped, and cleaning up records leftover from an unexpected termination. -jp

Thanks. i think managing a table recording an open/closed form will suit me best. the main menu option is not viable in this case. the clock works whether it is open or not, and i feel most users will probably only open it if it is to be updated. it does use up system resources. Regards, Farhan