Checking for form

Hi all… looking for a function to determine whether a form is open. And syntax to change the current form. I want to do something like this, starting from FormA: IF FORMISOPEN(form1variable) THEN CURRENTFORM := form1variable; form1variable.close; CURRENTFORM := FormA; Any thoughts would be appreciated! Chandler

There is no way to do what you are thinking about. Maybe if you give us a little more info, we can suggest different approaches.

Really all I want to do is see if a certain form is open, and if so close it. Is there really no way to do this in Navision? Chandler

You could make a table, there you insert (ie userid, formid) then if user open’s the form - the table is checked and record with that userid and formid found - form is closed. Simple, but effective. Since you haven’t described any special conditions it should work. You could also add a timer there and other conditions.

In C/Side help the close(form) method is described as only closing the current form. How would I switch from whatever form I happen to be in to the one I want to close?

You wouldn’t. If I correctly understand Tõnu’s idea, it would be up to the Form which you wish to close to periodically check if it should close itself.

Yep to Nelson. If I asked you ccbryan if you knew some code that would let me close explorer.exe on your computer if you opened My computer “page” from my (Tõnu’s) computer - what would you say ? :stuck_out_tongue: