September 23, 201015 yr When a user adds a note to our database, a new window opens with fields to add a note. This design is so the user can read information from the client's record while entering a note. There are times where the note-entry window fall's behind the client's record window. I see there is a function of Get(WindowVisible) that will return a number if it is visible or not but i was wondering if there was a function that would make a window visible. What i would like to do is when a user starts a new note, check to see if there is a note-entry window already open and bring it to the foreground so they can save their note before starting another. Hope this makes sense. Thanks
September 23, 201015 yr What i would like to do is when a user starts a new note, check to see if there is a note-entry window already open and bring it to the foreground so they can save their note before starting another. If the note entry window is consistently named then this is easy to do. In the script that opens the note window, issue a Select Window step and specify the note window name. Trap for errors. If a window with that name is open it will bring it forward. If there is no window with that name the Select Window step will return an error; use the Get( LastError ) function to check for a non-zero error and if so the window does not exist so make a new one. Set Variable [ $windowname ; "Notre Window" ] Set Error Capture [on] Select Window [ $windowname ] Set Variable [ $error ; Get( LastError ) ] Set Error Capture [off] If [ $error = 0 ] # WIndow already open ..etc.. Else New Window [ $windowname ] ...etc.. End If
September 24, 201015 yr Author The window is consistently named. I will give your example a try tomorrow. Thanks for the input.
Create an account or sign in to comment