- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to check if an iLogic form is active/shown?
Solved! Go to Solution.
Link copied
How to check if an iLogic form is active/shown?
Solved! Go to Solution.
I believe is not possible to check that.
...only the old way... looking to the screen 😅
It is not a Dockable window.
I'll dig deeper.
best i could think of is put it in a try/catch. Though, the form not showing would have to actually trigger an error. There is no 'formSuccess' function or anything. You can detect if they click yes/no/cancel, but I am not aware of anything telling if it displayed or not.
I'm making an "interactive" form.
Using check box to enable/disable different options.
Also change options in multilist properties.
Using a rule trigger by "Any user parameter change".
I want to "disable" the trigger when form is not shown.
So I'm try to add:
If Form.shown then
'only run update when form is active/shown
End if
I get the idea, but i'm not sure the option exists. I would think, in theory, if you're triggering a box on a parameter change, that you'd make you choices in the box and 'OK' it so the box goes away, then any subsequent change triggers a new box. If you're going to leave it on the screen, you'd need to detect it's presences, clear it, and reload it.
Not sure it's within the realm of ilogic, but you could use a rule to trigger the form, and something in it along the lines of 'if Launched = 1 then nothing, else show form. In your form, when it initializes, set launched = 1. When you close the form, set Launched = 0. That gives you something to key on, but there there's no built in event for this. If you are trying to keep this solely within ilogic, you'd have to assume the form always successfully launches. In which case you could do something like
if Launched = 0 then
Launched = 1
show.form
Launched = 0 'not sure if this works in ilogic the way it does in .net where it doesn't pass show.form until you close the form.
else
'form is already open, so do nothing
end if
Only thing is, not sure there is a way in pure ilogic to set Launched back to 0 when you close the form. You can do it in .net or VBA though, but then it won't trigger as a rule most likely.
I use True/False user parameter.
It work only when form is modal.
Parameter("FormActive") = True
iLogicForm.Show("Cab Config Test", FormMode.Modal)
Parameter("FormActive") = False