GlideModalForm - Client
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
The GlideModalForm API provides methods to display a form in a GlideModal.
Specify the query parameters that are passed to the form using the setPreference() method. Any name/value pair that you specify with setPreference() is sent along with the form POST request to display the form.
The GlideModalForm is set to fill the height of the document window.
GlideModalForm - GlideModalForm(String title, String tableName, Function onCompletionCallback, Boolean readOnly)
Creates an instance of the GlideModalForm class.
Example
This example shows how to instantiate a GlideModalForm object.
GlideModalForm - addParm(String name, String value)
Sets the specified form field to the specified value.
Name | Type | Description |
---|---|---|
name | String | Form field name. If the specified name is not a field in the associated modal form, it is ignored. |
value | String | Value to set the specified form field to. |
Type | Description |
---|---|
void |
Example
This example shows how to call addParm() to set the value of the sys_id field the modal form.
GlideModalForm - setSysID(String sys_id)
Sets the object's sys_id preference.
Name | Type | Description |
---|---|---|
sys_id | String | The id preference. One of the query parameters passed to the form. |
Type | Description |
---|---|
void |
Example
This example shows how to use the setSysID() method to initialize the value of the sys_id.
GlideModalForm - setCompletionCallback(Function callbackFunction)
Sets the function to be called when the form has been successfully submitted and processed by the server.
Name | Type | Description |
---|---|---|
callbackFunction | Function | Callback function to call when the form has been successfully processed. The
callback function has the form callbackFunction(String action_verb, String
sys_id, String table, String displayValue) where:
|
Type | Description |
---|---|
void |
Example
This example shows how to set the onload callback function of the associated modal.
GlideModalForm - setOnloadCallback(Function callbackFunction)
Sets the function to be called after the form has been loaded.
Name | Type | Description |
---|---|---|
callbackFunction | Function | Function to call after the form has been loaded. The callback function has the
form callBackFunction(GlideModalForm obj) |
Type | Description |
---|---|
void |
Example
This example shows how to set the on load callback function of the associated modal.
GlideModalForm - render()
Shows the modal form.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
void |
Example
This example shows how to call render() to display the modal.
On this page
- GlideModalForm - GlideModalForm(String title, String tableName, Function
onCompletionCallback, Boolean readOnly)
- GlideModalForm - addParm(String name, String value)
- GlideModalForm - setSysID(String sys_id)
- GlideModalForm - setCompletionCallback(Function callbackFunction)
- GlideModalForm - setOnloadCallback(Function callbackFunction)
- GlideModalForm - render()