PML Customisation
User Guide
Forms
:
Form Members
: Form Initialisation Callback
Form Initialisation Callback
The form’s
initialisation callback
allows the form’s gadgets to be initialised every time it is shown to reflect the current state of the application and possibly to validate whether the form can be displayed in the current context.
The callback will usually be a reference to a form method or possibly an open callback where several forms share a global initialisation function. Refer to
PML Open Callbacks
.
You can set the callback by assigning to the form’s
initcall
member. This can be done with the
INITCALL
command:
INITCALL ‘!This.InitCallBack()’
or directly by
!!MyForm.initcall = ‘This.InitCallBack()’
Note:
The form initialisation callback must not attempt to display another form. You may invoke an
ALERT
object but not otherwise seek any input from you.
If the callback discovers an error so serious that the form cannot be displayed it can abort the display of the form by returning an error. You can supply the text of an error message that is to be presented in an error alert in place of the form:
define method .initcallback()
:
return error 1 'You do not have write access to this database'
endmethod
If the initialisation callback has already caused an alert to be raised then you can prevent the raising of a new error alert by using the
NOALERT
keyword:
define method .initcallback()
:
return error 1 NOALERT
endmethod
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.