setFieldTouched() is used to set the value for the touched flag of the specified fields. The method needs two arguments: the fields list and the flag value:
There is some specifics about using variables with ui.Dialog methods.
You can learn about them here.
The reference rules for the fields are the same as with the getFieldTouched() method:
The value can be set as TRUE to set the fields as touched, and FALSE to set them as untouched:
CALL dialog.setFieldTouched("field1", true)
CALL dialog.setFieldTouched("formonly.field1", true)
CALL dialog.setFieldTouched("formonly.*", true)