GlideForm Flashcards

1
Q

How do you invoke the GlideForm object?

A

g_form.someFunction()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What overall functionality does GlideForm provide?

A

These methods are used to make custom changes to the form view of records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is GlideForm client side or server side?

A

Client Side

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Adds an icon on a field’s label in Client Script

A

g_form.addDecoration(String fieldName, String icon, String title)

OR

g_form.addDecoration(String fieldName, String icon, String title, String color)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Displays the specified error message at the top of the form in Client Script

A

g_form.addErrorMessage(String message)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Adds the specified informational message to the top of the form in Client Script

A

g_form.addInfoMessage(String message)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Adds a choice to the end of a choice list field in Client Script

A

g_form.addOption(String fieldName, String choiceValue, String choiceLabel)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Adds a choice to the choice list field at the position specified in Client Script

A

g_form.addOption(String fieldName, String choiceValue, String choiceLabel, Number choiceIndex)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Removes all informational and error messages from the top of the form in Client Script

A

g_form.clearMessages()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Removes all options from the choice list in Client Script

A

g_form.clearOptions(String fieldName)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Removes any value(s) from the field in Client Script

A

g_form.clearValue(String fieldName)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Prevents file attachments from being added to the form in Client Script

A

g_form.disableAttachments()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Allows file attachments to be added to the form in Client Script. Shows the paper clip icon.

A

g_form.enableAttachments()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Used to draw attention to a particular field. Flashes the specified color for a specified duration of time in the specified field in Client Script.

A

g_form.flash(String fieldName, String color, Number count)

This method is not supported by Service Catalog.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Returns the most recent action name, or, for a client script, the sys_id of the UI action clicked in Client Script

A

g_form.getActionName()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Returns a Boolean value for the specified field in Client Script

A

g_form.getBooleanValue(String fieldName)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Returns the HTML element for the specified field in Client Script

A

g_form.getControl(String fieldName)

Compound fields may contain several HTML elements. This method is generally not necessary as there are built-in methods that use the fields on a form.

If the field is a reference field and the control is a choice list, getControl() may not return a control as expected. In this case, use sys_select…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Returns the decimal value of the specified field in Client Script

A

g_form.getDecimalValue(String fieldName)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Returns the HTML element specified by the parameter in Client Script

A

g_form.getElement(String id)

Compound fields may contain several HTML elements. This method is generally not necessary as there are built-in methods that use the fields on a form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Returns the HTML element for the form in Client Script

A

g_form.getFormElement()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Returns the HTML element of the help text for the specified field in Client Script

A

g_form.getHelpTextControl(String fieldName)

This method is applicable to service catalog variables only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Returns the integer value of the field in Client Script

A

g_form.getIntValue(String fieldName)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Returns the plain text value of the field label in Client Script

A

g_form.getLabelOf(String fieldName)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Returns the option element for a selected box named fieldName where choiceValue matches the option value in Client Script

A

g_form.getOption(String fieldName, String choiceValue)

This method does not work on read-only fields.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Returns the GlideRecord for a specified field in Client Script

A

g_form.getReference(String fieldName, Function callBack)

If a callback function is present, this routine runs asynchronously. The browser (and script) processing continues normally until the server returns the reference value, at which time, the callback function is invoked. If a callback function is not present, this routine runs synchronously and processing halts (causing the browser to appear to hang) while waiting on a server response.

Important: It is strongly recommended that you use a callback function.
Callback function support for ServiceCatalogForm.getReference is available.

26
Q

Returns an array of related lists from the current form in the order in which they appear on that form in Client Script

A

g_form.getRelatedListNames()

27
Q

Returns all section names, whether visible or not in Client Script

A

g_form.getSectionNames()

28
Q

Returns an array of the form’s sections in Client Script

A

g_form.getSections()

29
Q

Returns the name of the table to which this record belongs in Client Script

A

g_form.getTableName()

30
Q

Returns the sys_id of the record displayed in the form in Client Script

A

g_form.getUniqueValue()

31
Q

Returns the value of the specified form field in Client Script

A

g_form.getValue(String fieldName)

This method also supports getting values from a multi-row variable set (MRVS). To obtain data from fields within an MRVS, you must first use JSON.parse(getValue(‘’)) to obtain the MRVS array, and then use indexing to access the fields within the row objects. For more details, see the code example below.

32
Q

Hides all field messages in Client Script

A

g_form.hideAllFieldMsgs()

33
Q

Hides all field messages of the specified type in Client Script

A

g_form.hideAllFieldMsgs(String type)

34
Q

Hides the last message or all messages placed by showFieldMsg() in Client Script

A

g_form.hideFieldMsg(String fieldName)

OR

g_form.hideFieldMsg(String fieldName, Boolean clearAll)

35
Q

Hides the specified related list on the form in Client Script

A

g_form.hideRelatedList(String listTableName)

36
Q

Hides all related lists on the form in Client Script

A

g_form.hideRelatedLists()

37
Q

Returns true while a live update is being done on the record the form is showing in Client Script

A

g_form.isLiveUpdating()

38
Q

Returns true if the field is mandatory in Client Script

A

g_form.isMandatory(String fieldName)

39
Q

Returns true if the record has never been saved in Client Script

A

g_form.isNewRecord()

40
Q

Returns true if the section is visible in Client Script

A

g_form.isSectionVisible(String sectionName)

41
Q

Registers a custom event listener that detects when any field in the current form is modified by a user in Client Script

A

g_form.onUserChangeValue(Function fn)

NOTE: Doesn’t work for journal fields

42
Q

Updates a list collector variable in Client Script

A

g_form.refreshSlushbucket(String fieldName)

43
Q

Removes the icon from the specified field that matches the icon and title in Client Script

A

g_form.removeDecoration(String fieldname, String icon, String title)

OR

g_form.removeDecoration(String fieldname, String icon, String title, String color)

NOTE: Not supported by Service Catalog

44
Q

Removes the specified option from the choice list in Client Script

A

g_form.removeOption(String fieldName, String choiceValue)

45
Q

Saves the record without navigating away (update and stay) in Client Script

A

g_form.save()

46
Q

Makes the specified field available or unavailable in Client Script

A

g_form.setDisabled(String fieldName, Boolean disable)

47
Q

Displays or hides a field in Client Script

A

g_form.setDisplay(String fieldName, Boolean display)

NOTE: Use UI Policies instead

48
Q

Sets the plain text value of the field label in Client Script

A

g_form.setLabelOf(String fieldName, String label)

49
Q

Makes the specified field mandatory in Client Script

A

g_form.setMandatory(String fieldName, Boolean mandatory)

NOTE: Use UI Policies instead

50
Q

Makes the specified field read only or editable in Client Script

A

g_form.setReadOnly(String fieldName, Boolean readOnly)

NOTE: Use UI Policies instead

51
Q

Shows or hides a section in Client Script

A

g_form.setSectionDisplay(String sectionName, Boolean display)

52
Q

Sets the value of a specified form field to the passed in value in Client Script

A

g_form.setValue(String fieldName, String value)

This method also supports setting values in a multi-row variable set (MRVS). You must first use JSON.parse(getValue(‘’)) to obtain the MRVS array and then use indexing to update the fields within the row objects. Once all values are updated in the MRVS, use the setValue() method to save the updated MRVS array.

53
Q

Sets the value of a specified form field to the value of a specified display value in a reference record in Client Script

A

g_form.setValue(String fieldName, String value, String displayValue)

NOTE: To improve performance by preventing a round trip when setting the value for a reference field, use this method, not setValue(fieldName, value). When setting multiple reference values for a list collector field, pass arrays in the value and displayValue parameters.

54
Q

Displays or hides the field in Client Script

A

g_form.setVisible(String fieldName, Boolean display)

NOTE: Use UI Policies instead

55
Q

Displays an error message under the specified form field (either a control object or the name of the field) in Client Script. If the control or field is currently off the screen, the form scrolls to the control or field

A

g_form.showErrorBox(String name, String message)

OR

g_form.showErrorBox(String name, String message, Boolean scrollForm)

56
Q

Displays either an informational or error message under the specified form field (either a control object or the name of the field) in Client Script. If the control or field is off the screen, the form is scrolled to the field.

A

g_form.showFieldMsg(String field, String message, String type)

OR

g_form.showFieldMsg(String field, String message, String type, Boolean scrollForm)

57
Q

Displays the specified related list on the form in Client Script

A

g_form.showRelatedList(String listTableName)

58
Q

Displays all the form’s related lists in Client Script

A

g_form.showRelatedLists()

59
Q

Saves and closes the record in Client Script

A

g_form.submit()

60
Q

Performs the UI action specified by the parameter in Client Script

A

g_form.submit(String verb)