setElementText() is used to change dynamically static form widgets. It changes the value of the TEXT attribute of a widget. It accepts two arguments: the name of the form widget and the new value for the TEXT attribute in a form of a character string. For example, you can change the text displayed by a static label in this way.
MAIN
DEFINE wo ui.Window,
fo ui.Form,
a string
OPEN WINDOW w1 AT 2,2 WITH FORM "my_form"
LET wo = ui.window.getCurrent()
LET fo = wo.getForm()
CALL fo.setElementText("main_label", "New Label Text")
END MAIN
setElementText() has a synonym - setFieldText() - that is used for compatibility purpose.