Question:
Can I keep more than one user from opening the same screen at the same time?
Solution:
Yes. The complete logic for it involves the Server, and is divided into six scripts (the following tag names are for clarification purposes only):
1. When you open the initial screen, save the computer’s name in the value of a Viewer tag called PCName by using WshNetwork object’s ComputerName property (check VBScript Reference Guide for further information). For example:
Application.Item(“PCName”).Value = WshNetwork.ComputerName
2. In the event fired by the user in order to open the screen (Click on a button, for example), pass the value of PCName tag to another tag in the Server called AccessRequest.
3. Create an OnValueChanged event in AccessRequest tag to check the value of ScreenStatus Boolean tag. If TRUE, the value of AccessRequest tag (containing the name of the computer where the Viewer is running) must be passed to AccessDenied tag. If FALSE, the value of AccessRequest tag must be passed to another tag in the Server called AcessOK, and ScreenStatus tag must be changed to TRUE.
4. On the initial screen, there should be a script to show a message box whenever AccessDenied tag changes value (informing the user about the denied access).
5. Also on the initial screen, there should be another script to open the intended command line whenever AccessOK tag changes value (indicating granted access).
6. Finally, when you close the command screen, the value of ScreenStatus and AccessOK tags must be reset.
NOTE: see the attached demo application.