Function::Internal
SetState
SetState("ObjectName",State)
SetState("MyButton",0) -- Hide
SetState(ObjectNameField,StateField)
retval := SetState("MyButtn",4) -- Click Event called. Same as button being clicked by mouse
SetState("MyObjectname","Hide")
SetState("ServiceWindow1","Show") -- will show ServiceWindow1 there is 4 service windows.

SetState is a function that will make it possible to manipulate objects from a derivation/DQL without having to use OML properties. SetState will hide/show, enable and disable.

Latest addition is ClickObject which will remotely call the click event on a button or any other object. Very useful for controlling execution.

Parameters

ObjectName (String) :

This is not the same as Column(Field) name. Object name is the name for the object in the GUI model and always need to be "quoted". "MyField", "MyButton" etc.

State (Number, "Number", "State"): This is the function you need to trigger:

"Hide", "0",0 

hide the object.

"Show","1",1 

show the object if it is hidden.

"Disable", "2", 2 

disable the object. A field will be write protected and a button will not be clickable etc. Will not affect OML.

"Enable" , "3", 3

enable the object. Remove write protect and will enable buttons, tab controls etc to be clickable again. Will not affect OML.

"Click", "4", 4 

ClickObject (Call Click Event on any object). If called for a button it will do the action and OML. WIll trigger OML on any object.

"MoveToFront"

Move the Object to front in the view i.e. it will be on top of all other objects. Ex. SetState("MyObject","MoveToFront")

"SendToBack"

Move the Object to Back in the view i.e. it will be behind all other objects. Ex. SetState("MyObject","MoveToBack")

System Version:

We also use SetState() to show ServiceWindows which is the new "toolbars" in DE9 onwards. These are 4 browser windows that can be utilised as part of your application as well.

SetState("ServiceWindow1","Show")
SetState("ServiceWindow4","Hide")
SetState("ServiceWIndow3","Refresh") -- refresh/reload content of service window.

Also see MoveObject()

Ex.
MoveObject("ServiceWindow1","L150","")

Returns/Result

Nothing.

Reference
SetState() will manipulate ScreenObjects like fields, buttons etc (in practice everything).

format SetState("Object",State) returns empty string so it can be included in any function without interfering with result of formula.

SetState("Field",0) will hide.
SetState("Field",1) will show.

SetState("Field",2) will disable
SetStage("Field",3) will enable.