<h2>GlideForm - addDecoration(String fieldName, String icon, String title, String color)</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="concept" /><meta name="DC.title" content="GlideForm" /><meta name="abstract" content="The GlideForm API provides methods to customize forms." /><meta name="description" content="The GlideForm API provides methods to customize forms." /><meta name="DC.subject" content="GlideForm, g_form, addDecoration(String fieldName, String icon, String title), addDecoration(String fieldName, String icon, String title, String color), addErrorMessage(String message), addInfoMessage(String message), addOption(String fieldName, String choiceValue, String choiceLabel), addOption(String fieldName, String choiceValue, String choiceLabel, Number choiceIndex), clearMessages(), clearOptions(String fieldName), clearValue(String fieldName), disableAttachments(), enableAttachments(), flash(String widgetName, String color, Number count), getActionName(), getBooleanValue(String fieldName), getControl(String fieldName), getDecimalValue(String fieldName), getElement(String id), getFormElement(), getHelpTextControl(String fieldName), getIntValue(String fieldName), getLabelOf(String fieldName), getOption(String fieldName, String choiceValue), getReference(String fieldName, Function callBack), GlideForm, getRelatedListNames(), getSectionNames(), getSections(), getTableName(), getUniqueValue(), getValue(String fieldName), hideAllFieldMsgs(), hideAllFieldMsgs(String type), hideErrorBox(String input), hideFieldMsg(String fieldName), hideRelatedList(String listTableName), hideRelatedLists(), isLiveUpdating(), isMandatory(String fieldName), isNewRecord(), isSectionVisible(String sectionName), onUserChangeValue(Function fn), refreshSlushbucket(String fieldName), removeDecoration(String fieldname, String icon, String title), removeDecoration(String fieldname, String icon, String title, String color), removeOption(String fieldName, String choiceValue), save(), setMandatory(String fieldName, Boolean mandatory), setSectionDisplay(String sectionName, Boolean display), setValue(String fieldName, String value, String displayValue), showErrorBox(String name, String message, Boolean scrollForm), showFieldMsg(String field, String message, String type), showFieldMsg(String field, String message, String type, Boolean scrollForm), setDisabled(String fieldName, Boolean disable), setDisplay(String fieldName, Boolean display), setLabelOf(String fieldName, String label), setReadOnly(String fieldName, Boolean readOnly), setValue(String fieldName, String value), setVisible(String fieldName, Boolean display), showErrorBox(String input, String message), showRelatedList(String listTableName), showRelatedLists(), submit(), submit(String verb)" /><meta name="keywords" content="GlideForm, g_form, addDecoration(String fieldName, String icon, String title), addDecoration(String fieldName, String icon, String title, String color), addErrorMessage(String message), addInfoMessage(String message), addOption(String fieldName, String choiceValue, String choiceLabel), addOption(String fieldName, String choiceValue, String choiceLabel, Number choiceIndex), clearMessages(), clearOptions(String fieldName), clearValue(String fieldName), disableAttachments(), enableAttachments(), flash(String widgetName, String color, Number count), getActionName(), getBooleanValue(String fieldName), getControl(String fieldName), getDecimalValue(String fieldName), getElement(String id), getFormElement(), getHelpTextControl(String fieldName), getIntValue(String fieldName), getLabelOf(String fieldName), getOption(String fieldName, String choiceValue), getReference(String fieldName, Function callBack), GlideForm, getRelatedListNames(), getSectionNames(), getSections(), getTableName(), getUniqueValue(), getValue(String fieldName), hideAllFieldMsgs(), hideAllFieldMsgs(String type), hideErrorBox(String input), hideFieldMsg(String fieldName), hideRelatedList(String listTableName), hideRelatedLists(), isLiveUpdating(), isMandatory(String fieldName), isNewRecord(), isSectionVisible(String sectionName), onUserChangeValue(Function fn), refreshSlushbucket(String fieldName), removeDecoration(String fieldname, String icon, String title), removeDecoration(String fieldname, String icon, String title, String color), removeOption(String fieldName, String choiceValue), save(), setMandatory(String fieldName, Boolean mandatory), setSectionDisplay(String sectionName, Boolean display), setValue(String fieldName, String value, String displayValue), showErrorBox(String name, String message, Boolean scrollForm), showFieldMsg(String field, String message, String type), showFieldMsg(String field, String message, String type, Boolean scrollForm), setDisabled(String fieldName, Boolean disable), setDisplay(String fieldName, Boolean display), setLabelOf(String fieldName, String label), setReadOnly(String fieldName, Boolean readOnly), setValue(String fieldName, String value), setVisible(String fieldName, Boolean display), showErrorBox(String input, String message), showRelatedList(String listTableName), showRelatedLists(), submit(), submit(String verb)" /><meta name="DC.relation" scheme="URI" content="../../../../../build/applications/concept/api-client.html" /><meta name="DC.relation" scheme="URI" content="../../../../../build/applications/concept/api-implementation-reference.html" /><meta name="DC.relation" scheme="URI" content="../../../../../build/applications/concept/api-reference.html" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2023-08-03" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="c_GlideFormAPI" /><link rel="stylesheet" type="text/css" href="../../../../../CSS/commonltr.css" /><title>GlideForm</title></head><body> <div class="nested0" id="c_GlideFormAPI"> <h1 class="title topictitle1" id="ariaid-title1">GlideForm </h1> <div class="body conbody"><p class="shortdesc">The <span class="keyword apiname">GlideForm</span> API provides methods to customize forms.</p> <p class="p">GlideForm.js is the JavaScript class containing the methods. The global object g_form is used to access <span class="keyword apiname">GlideForm</span> methods. <span class="keyword apiname">GlideForm</span> methods are only used on the client. These methods are used to make custom changes to the form view of records. All validation of examples was done using client scripts.</p> <p class="p">Some of these methods can also be used in other client scripts (such as Catalog Client Scripts or Wizard Client Scripts), but must first be tested to determine whether they will work as expected.</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> The methods <span class="keyword apiname">getControl()</span>, <span class="keyword apiname">getHelpTextControl()</span>, <span class="keyword apiname">getElement()</span>, and <span class="keyword apiname">getFormElement()</span> are deprecated for mobile devices. For information on using GlideForm for mobile, see <a class="xref" href="../script/client-scripts/reference/r_MobilePlatformMigrationImpacts.dita/r_MobilePlatformMigrationImpacts.html" target="_blank" rel="noopener noreferrer">Mobile Client GlideForm (g_form) Scripting and Migration</a>.</div> </div> <p class="p">There is no constructor for the <span class="keyword apiname">GlideForm</span> class. Access <span class="keyword apiname">GlideForm</span> methods using the g_form global object.</p> </div> <div class="related-links"> <div class="familylinks"> <div class="parentlink"><strong>Parent Topic:</strong> <a class="link" href="../../../../../build/applications/concept/api-client.html" title="Use client-side JavaScript APIs to control aspects of how Now Platform is displayed and functions within the web browser. This reference lists available classes and methods along with parameters, descriptions, and examples to help control the end-user experience.">Client API reference</a></div> </div> </div><div class="topic reference nested1 api-method" id="r_GlideForm-AddDecoration_S_S_S"> <h2 class="title topictitle2" id="ariaid-title2">GlideForm - addDecoration(String fieldName, String icon, String title)</h2> <div class="body refbody"><p class="shortdesc">Adds an icon on a field's label.</p> <div class="section"> <div class="p">Adding the same item twice is prevented; however, you can add the same icon with a different title. <div class="note"><span class="notetitle">Note:</span> This method is not supported by Service Catalog.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-AddDecoration_S_S_S__table_vyw_1dw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 1. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e198">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e201">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e204">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e198 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e201 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e204 ">The field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e198 ">icon</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e201 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e204 ">The font icon to show next to the field. Supported icons - icon-user, icon-user-group, icon-lightbulb, icon-home, icon-mobile, icon-comment, icon-mail, icon-locked, icon-database, icon-book, icon-drawer, icon-folder, icon-catalog, icon-tab, icon-cards, icon-tree-right, icon-tree, icon-book-open, icon-paperclip, icon-edit, icon-trash, icon-image, icon-search, icon-power, icon-cog, icon-star, icon-star-empty, icon-new-ticket, icon-dashboard, icon-cart-full, icon-view, icon-label, icon-filter, icon-calendar, icon-script, icon-add, icon-delete, icon-help, icon-info, icon-check-circle, icon-alert, icon-sort-ascending, icon-console, icon-list, icon-form, and icon-livefeed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e198 ">title</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e201 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e204 ">The text title for the icon.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-AddDecoration_S_S_S__table_wyw_1dw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 2. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e265">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e268">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e265 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e268 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.addDecoration('caller_id', 'icon-star', 'preferred member');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideForm-AddDecoration_S_S_S_S"> <h2 class="title topictitle2" id="ariaid-title3">GlideForm - addDecoration(String fieldName, String icon, String title, String color)</h2> <div class="body refbody"><p class="shortdesc">Adds an icon on a field's label.</p> <div class="section"> <div class="p">Adding the same item twice is prevented; however, you can add the same icon with a different title. <div class="note"><span class="notetitle">Note:</span> This method is not supported by Service Catalog.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-AddDecoration_S_S_S_S__table_gzh_fyd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 3. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e358">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e361">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e364">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e358 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e361 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e364 ">The field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e358 ">icon</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e361 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e364 ">The font icon to show next to the field. Supported icons - icon-user, icon-user-group, icon-lightbulb, icon-home, icon-mobile, icon-comment, icon-mail, icon-locked, icon-database, icon-book, icon-drawer, icon-folder, icon-catalog, icon-tab, icon-cards, icon-tree-right, icon-tree, icon-book-open, icon-paperclip, icon-edit, icon-trash, icon-image, icon-search, icon-power, icon-cog, icon-star, icon-star-empty, icon-new-ticket, icon-dashboard, icon-cart-full, icon-view, icon-label, icon-filter, icon-calendar, icon-script, icon-add, icon-delete, icon-help, icon-info, icon-check-circle, icon-alert, icon-sort-ascending, icon-console, icon-list, icon-form, and icon-livefeed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e358 ">title</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e361 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e364 ">The text title for the icon.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e358 ">color</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e361 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e364 ">A CSS color.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-AddDecoration_S_S_S_S__table_hzh_fyd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 4. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e437">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e440">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e437 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e440 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.addDecoration('caller_id', 'icon-star', 'Mark as Favorite', 'color-green');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormAddErrorMessage_String"> <h2 class="title topictitle2" id="ariaid-title4">GlideForm - addErrorMessage(String message)</h2> <div class="body refbody"><p class="shortdesc">Displays the specified error message at the top of the form.</p> <div class="section"> <p class="p">This message appears for approximately four seconds and then disappears. This timeout is not configurable at this time.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormAddErrorMessage_String__table_fyn_vnd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 5. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e529">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e532">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e535">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e529 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e532 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e535 ">Message to display.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormAddErrorMessage_String__table_gyn_vnd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 6. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e572">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e575">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e572 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e575 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.addErrorMessage('This is an error');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-addFormMessage_S_S"> <h2 class="title topictitle2" id="ariaid-title5">GlideForm - addFormMessage(String message, String type)</h2> <div class="body refbody"><p class="shortdesc">Displays a floating form message at the top of the form detail section. The message does not cover UI actions.</p> <div class="section"> <div class="p">See also:<ul class="ul" id="GF-addFormMessage_S_S__ul_unz_vkt_4pb"><li class="li"><a class="xref" href="c_GlideFormAPI.html#GF-clearAllFormMessages" title="Removes all form messages of any type.">clearAllFormMessages()</a></li><li class="li"><a class="xref" href="c_GlideFormAPI.html#GF-clearFormMessages_S" title="Removes all form messages of a given type.">clearFormMessages()</a></li></ul> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-addFormMessage_S_S__table_f2v_zym_4pb" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 7. </span>Parameters</span></caption><colgroup><col style="width:16.666666666666664%" /><col style="width:16.666666666666664%" /><col style="width:66.66666666666666%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e669">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e672">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e675">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e669 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e672 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e675 ">Message to display.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e669 ">type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e672 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e675 ">The type of message.<div class="p">Valid values:<ul class="ul" id="GF-addFormMessage_S_S__ul_gzv_bbn_4pb"><li class="li">error</li><li class="li">info</li><li class="li">warning</li></ul> </div> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-addFormMessage_S_S__table_g2v_zym_4pb" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 8. </span>Returns</span></caption><colgroup><col style="width:25%" /><col style="width:75%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e737">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e740">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e737 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e740 "> </td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">The following example shows how to add form messages of each type.</p> <pre class="pre codeblock"><code>g_form.addFormMessage('info message','info'); g_form.addFormMessage('warning message','warning'); g_form.addFormMessage('error message','error'); g_form.addFormMessage('info2 message','info'); g_form.addFormMessage('warning2 message','warning'); g_form.addFormMessage('error2 message','error');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormAddInfoMessage_String"> <h2 class="title topictitle2" id="ariaid-title6">GlideForm - addInfoMessage(String message)</h2> <div class="body refbody"><p class="shortdesc">Adds the specified informational message to the top of the form.</p> <div class="section"> <p class="p">This message appears for approximately four seconds and then disappears. This timeout is not configurable at this time.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormAddInfoMessage_String__table_pcg_n4d_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 9. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e832">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e835">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e838">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e832 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e835 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e838 ">Message to display.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormAddInfoMessage_String__table_qcg_n4d_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 10. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e875">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e878">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e875 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e878 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.addInfoMessage('The top five fields in this form are mandatory');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-AddOption_S_S_S"> <h2 class="title topictitle2" id="ariaid-title7">GlideForm - addOption(String fieldName, String choiceValue, String choiceLabel)</h2> <div class="body refbody"><p class="shortdesc">Adds a choice to the end of a choice list field.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-AddOption_S_S_S__table_omk_pgd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 11. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e963">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e966">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e969">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e963 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e966 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e969 ">The name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e963 ">choiceValue</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e966 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e969 ">The value to be stored in the database.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e963 ">choiceLabel</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e966 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e969 ">The value displayed.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-AddOption_S_S_S__table_pmk_pgd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 12. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1030">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1033">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1030 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1033 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.addOption('priority', '6', '6 - Really Low');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideForm-AddOption_S_S_S_N"> <h2 class="title topictitle2" id="ariaid-title8">GlideForm - addOption(String fieldName, String choiceValue, String choiceLabel, Number choiceIndex)</h2> <div class="body refbody"><p class="shortdesc">Adds a choice to the list field at the position specified.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> Duplicate list labels are not supported in <span class="ph">Service Portal</span>. For example, items with label text matching another label are ignored and not added to the list.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-AddOption_S_S_S_N__table_k5s_qhd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 13. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1126">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1129">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1132">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1126 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1129 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1132 ">The field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1126 ">choiceValue</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1129 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1132 ">The value stored in the database.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1126 ">choiceLabel</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1129 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1132 ">The value displayed.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1126 ">choiceIndex</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1129 ">Number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1132 ">Order of the choice in the list. The index is into a zero based array.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-AddOption_S_S_S_N__table_l5s_qhd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 14. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1205">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1208">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1205 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1208 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.addOption('priority', '2.5', '2.5 - Moderately High', 3);</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormClearMessages"> <h2 class="title topictitle2" id="ariaid-title9">GlideForm - clearMessages()</h2> <div class="body refbody"><p class="shortdesc">Removes all informational and error messages from the top of the form.</p> <div class="section"> <p class="p">Removes informational and error messages added with <span class="keyword apiname">g_form.addInfoMessage()</span> and <span class="keyword apiname">g_form.addErrorMessage()</span>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormClearMessages__table_krr_y4d_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 15. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1302">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1305">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1308">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1302 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1305 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1308 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormClearMessages__table_lrr_y4d_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 16. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1343">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1346">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1343 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1346 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.clearMessages();</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-clearAllFormMessages"> <h2 class="title topictitle2" id="ariaid-title10">GlideForm - clearAllFormMessages()</h2> <div class="body refbody"><p class="shortdesc">Removes all form messages of any type.</p> <div class="section"> <div class="p">See also:<ul class="ul" id="GF-clearAllFormMessages__ul_unz_vkt_4pb"><li class="li"><a class="xref" href="c_GlideFormAPI.html#GF-addFormMessage_S_S" title="Displays a floating form message at the top of the form detail section. The message does not cover UI actions.">addFormMessage()</a></li><li class="li"><a class="xref" href="c_GlideFormAPI.html#GF-clearFormMessages_S" title="Removes all form messages of a given type.">clearFormMessages()</a></li></ul> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-clearAllFormMessages__table_qpm_dzm_4pb" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 17. </span>Parameters</span></caption><colgroup><col style="width:16.666666666666664%" /><col style="width:16.666666666666664%" /><col style="width:66.66666666666666%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1441">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1444">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1447">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1441 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1444 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1447 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-clearAllFormMessages__table_rpm_dzm_4pb" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 18. </span>Returns</span></caption><colgroup><col style="width:25%" /><col style="width:75%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1482">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1485">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1482 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1485 "> </td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">The following example shows how to clear all messages from the form.</p> <pre class="pre codeblock"><code>g_form.clearAllFormMessages();</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-clearFormMessages_S"> <h2 class="title topictitle2" id="ariaid-title11">GlideForm - clearFormMessages(String type)</h2> <div class="body refbody"><p class="shortdesc">Removes all form messages of a given type.</p> <div class="section"> <div class="p">See also:<ul class="ul" id="GF-clearFormMessages_S__ul_unz_vkt_4pb"><li class="li"><a class="xref" href="c_GlideFormAPI.html#GF-addFormMessage_S_S" title="Displays a floating form message at the top of the form detail section. The message does not cover UI actions.">addFormMessage()</a></li><li class="li"><a class="xref" href="c_GlideFormAPI.html#GF-clearAllFormMessages" title="Removes all form messages of any type.">clearAllFormMessages()</a></li></ul> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-clearFormMessages_S__table_ilw_bzm_4pb" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 19. </span>Parameters</span></caption><colgroup><col style="width:16.666666666666664%" /><col style="width:16.666666666666664%" /><col style="width:66.66666666666666%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1582">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1585">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1588">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1582 ">type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1585 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1588 ">The type of message.<div class="p">Valid values:<ul class="ul" id="GF-clearFormMessages_S__ul_gzv_bbn_4pb"><li class="li">error</li><li class="li">info</li><li class="li">warning</li></ul> </div> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-clearFormMessages_S__table_jlw_bzm_4pb" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 20. </span>Returns</span></caption><colgroup><col style="width:25%" /><col style="width:75%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1638">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1641">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1638 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1641 "> </td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">The following example shows how to clear all error messages from the form.</p> <pre class="pre codeblock"><code>g_form.clearFormMessages('error');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormClearOptions_String"> <h2 class="title topictitle2" id="ariaid-title12">GlideForm - clearOptions(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Removes all options from the choice list.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormClearOptions_String__table_bdt_v3d_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 21. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1730">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1733">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1736">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1730 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1733 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1736 ">Name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormClearOptions_String__table_cdt_v3d_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 22. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1773">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1776">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1773 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1776 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormClearValue_String"> <h2 class="title topictitle2" id="ariaid-title13">GlideForm - clearValue(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Removes any value(s) from the field.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormClearValue_String__table_tlr_znc_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 23. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1855">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1858">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1861">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1855 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1858 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1861 ">Name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormClearValue_String__table_ulr_znc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 24. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1898">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1901">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1898 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1901 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormDisableAttachments"> <h2 class="title topictitle2" id="ariaid-title14">GlideForm - disableAttachments()</h2> <div class="body refbody"><p class="shortdesc">Prevents file attachments from being added.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormDisableAttachments__table_ggk_bqd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 25. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1984">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1987">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e1990">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1984 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1987 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e1990 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormDisableAttachments__table_hgk_bqd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 26. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2025">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2028">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2025 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2028 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormEnableAttachments"> <h2 class="title topictitle2" id="ariaid-title15">GlideForm - enableAttachments()</h2> <div class="body refbody"><p class="shortdesc">Allows file attachments to be added. Shows the paper clip icon.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormEnableAttachments__table_i3c_ppd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 27. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2110">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2113">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2116">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2110 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2113 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2116 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormEnableAttachments__table_j3c_ppd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 28. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2151">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2154">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2151 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2154 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormFlash_String_String_Number"> <h2 class="title topictitle2" id="ariaid-title16">GlideForm - flash(String fieldName, String color, Number count)</h2> <div class="body refbody"><p class="shortdesc">Used to draw attention to a particular field. Flashes the specified color for a specified duration of time in the specified field.</p> <div class="section"> <p class="p">This method is not supported by Service Catalog.</p> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormFlash_String_String_Number__table_htn_w2w_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 29. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2240">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2243">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2246">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2240 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2243 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2246 ">Specifies the field to highlight in the following format: <code class="ph codeph">"<table-name>.<field-name>"</code>.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2240 ">color</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2243 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2246 ">RGB color or acceptable CSS color.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2240 ">count</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2243 ">Number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2246 ">Specifies how long the label will flash. Options include:<ul class="ul" id="r_GlideFormFlash_String_String_Number__ul_qcc_4fw_ts"><li class="li">2: Flashes for 1 second</li><li class="li">0: Flashes for 2 seconds</li><li class="li">-2: Flashes for 3 seconds</li><li class="li">-4: Flashes for 4 seconds</li></ul> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormFlash_String_String_Number__table_itn_w2w_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 30. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2324">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2327">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2324 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2327 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.flash("incident.number", "#FFFACD", 0);</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetActionName"> <h2 class="title topictitle2" id="ariaid-title17">GlideForm - getActionName()</h2> <div class="body refbody"><p class="shortdesc">Returns the most recent action name, or, for a client script, the sys_id of the UI action clicked.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> Not available in Wizard client scripts.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetActionName__table_zhn_xjd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 31. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2416">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2419">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2422">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2416 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2419 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2422 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetActionName__table_a3n_xjd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 32. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2457">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2460">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2457 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2460 ">The current action name.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onSubmit() { var action = g_form.getActionName(); alert('You pressed ' + action); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetBooleanValue_String"> <h2 class="title topictitle2" id="ariaid-title18">GlideForm - getBooleanValue(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns a Boolean value for the specified field.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetBooleanValue_String__table_vfk_25b_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 33. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2547">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2550">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2553">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2547 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2550 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2553 ">Name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetBooleanValue_String__table_wfk_25b_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 34. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2590">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2593">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2590 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2593 ">Returns false if the field value is false or undefined; otherwise returns true.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetControl_String"> <h2 class="title topictitle2" id="ariaid-title19">GlideForm - getControl(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns the HTML element for the specified field.</p> <div class="section"> <p class="p">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.</p> <p class="p">If the field is a reference field and the control is a choice list, <span class="keyword apiname">getControl()</span> may not return a control as expected. In this case, use <code class="ph codeph">sys_select.<table name>.<field name></code>.</p> <p class="p">This method is not available in mobile scripts or Service Portal scripts.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetControl_String__table_lzt_x5b_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 35. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2688">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2691">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2694">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2688 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2691 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2694 ">Name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetControl_String__table_mzt_x5b_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 36. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2731">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2734">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2731 ">HTMLElement</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2734 ">The field's HTML element.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetDecimalValue_String"> <h2 class="title topictitle2" id="ariaid-title20">GlideForm - getDecimalValue(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns the decimal value of the specified field.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetDecimalValue_String__table_izt_31c_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 37. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2815">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2818">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2821">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2815 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2818 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2821 ">The name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetDecimalValue_String__table_jzt_31c_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 38. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2858">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2861">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2858 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2861 ">The decimal value of the specified field.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { alert(g_form.getDecimalValue('percent_complete')); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-getDisplayBox_S"> <h2 class="title topictitle2" id="ariaid-title21">GlideForm - getDisplayBox(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Gets the display value from a form in the core UI.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> To get a display value from a form in <span class="ph">Service Portal</span>, use the <a class="xref" href="c_GlideFormAPI.html#GF-getDisplayValue_S" title="Gets the display value from a form in Service Portal.">getDisplayValue()</a> method.</div> </div> <div class="p">See also:<ul class="ul" id="GF-getDisplayBox_S__ul_djx_h4g_cvb"><li class="li"><a class="xref" href="c_GlideFormAPI.html#r_GlideFormGetValue_String" title="Returns the value of the specified form field.">getValue()</a></li><li class="li"><a class="xref" href="https://www.servicenow.com/community/developer-blog/get-display-value-of-reference-variable-service-catalog/ba-p/2287763" target="_blank" rel="noopener noreferrer">Get the display value of a reference variable</a></li></ul> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-getDisplayBox_S__table_nf2_bfp_zw" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 39. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2970">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2973">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e2976">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2970 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2973 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e2976 ">Name of the field from which you want to retrieve a value in the form.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-getDisplayBox_S__table_ydf_qpc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 40. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3013">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3016">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3013 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3016 "> </td></tr></tbody></table> </div> </div> <div class="example" id="GF-getDisplayBox_S__example_rgd_ddh_45b"> <pre class="pre codeblock"><code>var caller = g_form.getDisplayBox('caller_id').value; var assignee = g_form.getDisplayBox('assigned_to').value; if (caller == assignee) { alert('in'); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-getDisplayValue_S"> <h2 class="title topictitle2" id="ariaid-title22">GlideForm - getDisplayValue(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Gets the display value from a form in <span class="ph">Service Portal</span>.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> To get a display value from a form in the core UI, use the <a class="xref" href="c_GlideFormAPI.html#GF-getDisplayBox_S" title="Gets the display value from a form in the core UI.">getDisplayBox()</a> method.</div> </div> <div class="p">See also:<ul class="ul" id="GF-getDisplayValue_S__ul_djx_h4g_cvb"><li class="li"><a class="xref" href="c_GlideFormAPI.html#r_GlideFormGetValue_String" title="Returns the value of the specified form field.">getValue()</a></li><li class="li"><a class="xref" href="https://www.servicenow.com/community/developer-blog/get-display-value-of-reference-variable-service-catalog/ba-p/2287763" target="_blank" rel="noopener noreferrer">Get the display value of a reference variable</a></li></ul> </div> <div class="p"><div class="note"><span class="notetitle">Note:</span> In the core UI, calling this method as <code class="ph codeph">g_form.getDisplayValue()</code> without an argument returns the record display value rather than the display value of an individual field.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-getDisplayValue_S__table_nf2_bfp_zw" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 41. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3129">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3132">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3135">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3129 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3132 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3135 ">Name of the field from which you want to retrieve a value in the form.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-getDisplayValue_S__table_ydf_qpc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 42. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3172">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3175">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3172 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3175 "> </td></tr></tbody></table> </div> </div> <div class="example" id="GF-getDisplayValue_S__example_rgd_ddh_45b"> <p class="p">The following example shows how to get the display value of a reference variable in the core UI or <span class="ph">Service Portal</span>. The use case for this example is on the <a class="xref" href="https://www.servicenow.com/community/developer-blog/get-display-value-of-reference-variable-service-catalog/ba-p/2287763" target="_blank" rel="noopener noreferrer">community</a> site.</p> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } if(window == null){ var valuePortal = g_form.getDisplayValue('requester'); alert('Portal->' + valuePortal); } else{ var valueNative = g_form.getDisplayBox('requester').value; alert('CoreUI->' + valueCoreUI); } //Type appropriate comment here, and begin script below }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetElement_String"> <h2 class="title topictitle2" id="ariaid-title23">GlideForm - getElement(String id)</h2> <div class="body refbody"><p class="shortdesc">Returns the HTML element specified by the parameter.</p> <div class="section"> <p class="p">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.</p> <p class="p">This method is not available in mobile scripts or Service Portal scripts.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetElement_String__table_l1k_vvb_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 43. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3276">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3279">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3282">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3276 ">id</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3279 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3282 ">The field id.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetElement_String__table_m1k_vvb_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 44. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3319">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3322">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3319 ">HTMLElement</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3322 ">The field's HTML element.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetFormElement"> <h2 class="title topictitle2" id="ariaid-title24">GlideForm - getFormElement()</h2> <div class="body refbody"><p class="shortdesc">Returns the HTML element for the form.</p> <div class="section"> <p class="p">This method is not available in mobile scripts or Service Portal scripts.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetFormElement__table_fs4_kkd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 45. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3406">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3409">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3412">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3406 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3409 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3412 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetFormElement__table_gs4_kkd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 46. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3447">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3450">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3447 ">HTMLFormElement</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3450 ">The HTML element for the form.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-getHelpTextControl_S"> <h2 class="title topictitle2" id="ariaid-title25">GlideForm - getHelpTextControl(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns the HTML element of the help text for the specified field.</p> <div class="section"> <p class="p">This method is applicable to service catalog variables only.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-getHelpTextControl_S__table_nf2_bfp_zw" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 47. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3533">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3536">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3539">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3533 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3536 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3539 ">Name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-getHelpTextControl_S__table_of2_bfp_zw" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 48. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3576">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3579">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3576 ">HTMLElement</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3579 ">Help text field's HTML element.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetIntValue_String"> <h2 class="title topictitle2" id="ariaid-title26">GlideForm - getIntValue(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns the integer value of the field.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetIntValue_String__table_unc_nwb_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 49. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3660">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3663">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3666">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3660 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3663 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3666 ">The field name.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetIntValue_String__table_vnc_nwb_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 50. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3703">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3706">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3703 ">Number</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3706 ">Integer value of the field.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetLabelOf_String"> <h2 class="title topictitle2" id="ariaid-title27">GlideForm - getLabelOf(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns the plain text value of the field label.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetLabelOf_String__table_gfz_kgw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 51. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3786">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3789">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3792">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3786 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3789 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3792 ">The field name</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetLabelOf_String__table_hfz_kgw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 52. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3829">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3832">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3829 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3832 ">The label text.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>if (g_user.hasRole('itil')) { var oldLabel = g_form.getLabelOf('comments'); g_form.setLabelOf('comments', oldLabel + ' (Customer visible)'); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetOption_String_String"> <h2 class="title topictitle2" id="ariaid-title28">GlideForm - getOption(String fieldName, String choiceValue)</h2> <div class="body refbody"><p class="shortdesc">Returns the option element for a selected box named <span class="keyword parmname">fieldName</span> where <span class="keyword parmname">choiceValue</span> matches the option value.</p> <div class="section"> <div class="note"><span class="notetitle">Note:</span> This method does not work on read-only fields.</div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetOption_String_String__table_u1p_1xb_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 53. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3928">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3931">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3934">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3928 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3931 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3934 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3928 ">choiceValue</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3931 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3934 ">Value of the option.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetOption_String_String__table_v1p_1xb_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 54. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3983">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e3986">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3983 ">HTMLElement</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e3986 ">The HTMLElement for the option. Returns null if the field or option is not found.</td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">The following example shows how to get the label for a choice list value.</p> <pre class="pre codeblock"><code>// Get the label for a choice list value // fieldName is 'category' function onChange(control, oldValue, newValue, isLoading) { var choiceValue = g_form.getValue('category'); var choiceLabel = g_form.getOption('category', choiceValue).text; }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideForm-GetReference_S_F"> <h2 class="title topictitle2" id="ariaid-title29">GlideForm - getReference(String fieldName, Function callBack)</h2> <div class="body refbody"><p class="shortdesc">Returns the GlideRecord for a specified field.</p> <div class="section"> <p class="p">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.</p> <div class="p"><div class="note important"><span class="importanttitle">Important:</span> It is strongly recommended that you use a callback function.</div> </div> <p class="p">Callback function support for ServiceCatalogForm.getReference is available.</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> Using this method requires a call to the server which requires additional time and may introduce latency to your page. Use this method with caution. For additional information, see <a class="xref" href="../script/client-scripts/concept/client-script-best-practices.dita/client-script-best-practices.html" target="_blank" rel="noopener noreferrer">Client script design and processing</a>.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-GetReference_S_F__table_k4c_1yb_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 55. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4093">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4096">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4099">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4093 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4096 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4099 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4093 ">callBack</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4096 ">Function</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4099 ">Name of the call back function.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-GetReference_S_F__table_l4c_1yb_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 56. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4149">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4152">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4149 ">GlideRecord</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4152 ">GlideRecord object for the specified field. <p class="p">If the specified reference cannot be found, it returns an initialized GlideRecord object where currentRow = -1 and rows.length = 0.</p> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { g_form.getReference('caller_id', doAlert); // doAlert is our callback function } function doAlert(caller) { // reference is passed into callback as first arguments if (caller.getValue('vip') == 'true') { alert('Caller is a VIP!'); } }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-getRelatedListNames"> <h2 class="title topictitle2" id="ariaid-title30">GlideForm - getRelatedListNames()</h2> <div class="body refbody"><p class="shortdesc">Returns an array of related list names from the current form.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-getRelatedListNames__table_vfp_grv_dhb" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 57. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4241">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4244">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4247">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4241 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4244 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4247 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-getRelatedListNames__table_wfp_grv_dhb" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 58. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4282">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4285">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4282 ">Array</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4285 ">String array of related list names from the current form. The related list names are listed in the order in which they appear on the form.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>var listNames = g_form.getRelatedListNames(); for (var i = 0; i < listNames.length; i++) { this.showRelatedList(listNames[i]); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetSectionNames"> <h2 class="title topictitle2" id="ariaid-title31">GlideForm - getSectionNames()</h2> <div class="body refbody"><p class="shortdesc">Returns all section names, whether visible or not.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetSectionNames__table_rsg_vkd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 59. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4371">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4374">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4377">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4371 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4374 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4377 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetSectionNames__table_ssg_vkd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 60. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4412">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4415">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4412 ">Array of strings</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4415 ">The section names.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetSections"> <h2 class="title topictitle2" id="ariaid-title32">GlideForm - getSections()</h2> <div class="body refbody"><p class="shortdesc">Returns an array of the form's sections.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetSections__table_sg4_hld_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 61. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4499">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4502">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4505">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4499 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4502 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4505 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetSections__table_tg4_hld_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 62. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4540">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4543">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4540 ">Array of HTML elements</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4543 ">The form's sections.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { //this example was run on a form divided into sections (Change form) // and hid a section when the "state" field was changed var sections = g_form.getSections(); if (newValue == '2') { g_form.setSectionDisplay(sections[1], false); } else { g_form.setSectionDisplay(sections[1], true); } }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetTableName"> <h2 class="title topictitle2" id="ariaid-title33">GlideForm - getTableName()</h2> <div class="body refbody"><p class="shortdesc">Returns the name of the table to which this record belongs.</p> <div class="section"> <p class="p">On the server side, the table for the current record can be retrieved with <span class="keyword apiname">current.sys_class_name</span> or <span class="keyword apiname">current.getTableName()</span>.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetTableName__table_gqk_5ld_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 63. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4638">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4641">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4644">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4638 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4641 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4644 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetTableName__table_hqk_5ld_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 64. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4679">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4682">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4679 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4682 ">Name of the table.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onLoad() { if (g_form.isNewRecord()) { var tableName = g_form.getTableName(); //Get the table name } }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetUniqueValue"> <h2 class="title topictitle2" id="ariaid-title34">GlideForm - getUniqueValue()</h2> <div class="body refbody"><p class="shortdesc">Returns the sys_id of the record displayed in the form.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetUniqueValue__table_xxg_lmd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 65. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4769">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4772">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4775">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4769 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4772 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4775 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetUniqueValue__table_yxg_lmd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 66. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4810">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4813">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4810 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4813 ">The record's sys_id.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onLoad() { var incSysid = g_form.getUniqueValue(); alert(incSysid); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormGetValue_String"> <h2 class="title topictitle2" id="ariaid-title35">GlideForm - getValue(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns the value of the specified form field.</p> <div class="section"> <p class="p">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 <code class="ph codeph">JSON.parse(getValue('<mrvs_field_name>') || '[]')</code> 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.</p> </div> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetValue_String__table_nxm_wzb_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 67. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4908">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4911">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4914">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4908 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4911 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4914 ">Name of the field whose value to return.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormGetValue_String__table_oxm_wzb_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 68. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4951">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e4954">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4951 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e4954 ">Value of the specified field.</td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">The following example shows how to get the short description from the current form.</p> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { alert(g_form.getValue('short_description')); }</code></pre> </div> <div class="example"> <p class="p">The following example shows how to get values from an MRVS. In this example, salaries are being managed through the Service Catalog. The client script searches all rows within the MRVS for the value entered in the <span class="ph uicontrol">Job title</span> and then updates the matching entries within the MRVS with what is entered in the <span class="ph uicontrol">Salary</span> field. The MRVS is named "variable_set_1" and contains the following fields within each row object: Employee name [employee_name], Job title [employee_job_title], and Salary [employee_salary]. In addition, the Catalog Item contains: Job title [job_title] and Salary [salary].</p> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } // Get the MRVS var vs1 = g_form.getValue('variable_set_1') || '[]'; var multiRowVariableSet = JSON.parse(vs1); for (var i = 0; i < multiRowVariableSet.length; i++) { // Check if the entered job title matches the title in the current MRVS row if (multiRowVariableSet[i].employee_job_title == g_form.getValue("job_title")){ // Update the value of a matching field with the new salary multiRowVariableSet[i].employee_salary = newValue; } } // Update the MRVS g_form.setValue('variable_set_1', JSON.stringify(multiRowVariableSet)); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormHideAllFieldMsgs"> <h2 class="title topictitle2" id="ariaid-title36">GlideForm - hideAllFieldMsgs()</h2> <div class="body refbody"><p class="shortdesc">Hides all field messages.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideAllFieldMsgs__table_mr1_3hw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 69. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5059">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5062">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5065">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5059 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5062 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5065 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideAllFieldMsgs__table_nr1_3hw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 70. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5100">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5103">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5100 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5103 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormHideAllFieldMsgs_String"> <h2 class="title topictitle2" id="ariaid-title37">GlideForm - hideAllFieldMsgs(String type)</h2> <div class="body refbody"><p class="shortdesc">Hides all field messages of the specified type.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideAllFieldMsgs_String__table_y2c_qhw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 71. </span>Parameters</span></caption><colgroup><col style="width:16.666666666666664%" /><col style="width:16.666666666666664%" /><col style="width:66.66666666666666%" /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5182">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5185">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5188">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5182 ">type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5185 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5188 ">The type of message.<div class="p">Valid values:<ul class="ul" id="r_GlideFormHideAllFieldMsgs_String__ul_gzv_bbn_4pb"><li class="li">error</li><li class="li">info</li></ul> </div> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideAllFieldMsgs_String__table_z2c_qhw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 72. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5235">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5238">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5235 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5238 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormHideErrorBox_String"> <h2 class="title topictitle2" id="ariaid-title38">GlideForm - hideErrorBox(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Hides the error message placed by <span class="keyword apiname">showErrorBox()</span>.</p> <div class="section"> <p class="p">Whenever possible, use <span class="keyword apiname">hideFieldMsg()</span> rather than this method whenever possible.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideErrorBox_String__table_kll_t4w_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 73. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5327">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5330">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5333">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5327 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5330 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5333 ">The name of the field or control.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideErrorBox_String__table_lll_t4w_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 74. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5370">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5373">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5370 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5373 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormHideFieldMsg_String"> <h2 class="title topictitle2" id="ariaid-title39">GlideForm - hideFieldMsg(String fieldName, Boolean clearAll)</h2> <div class="body refbody"><p class="shortdesc">Hides the first message that appears in the specified field on the current form.</p> <div class="section"> <p class="p">Use the <a class="xref" href="c_GlideFormAPI.html#r_GF-ShowFieldMsg_S_S_S" title="Displays either an informational or error message under the specified form field (either a control object or the name of the field). If the control or field is off the screen, the form is scrolled to the field.">GlideForm - showFieldMsg(String field, String message, String type)</a> or <a class="xref" href="c_GlideFormAPI.html#r_GF-ShowFieldMsg_S_S_S_B" title="Displays either an informational or error message under the specified form field (either a control object or the name of the field). If the control or field is currently off the screen and scrollForm is true, the form is scrolled to the field.">GlideForm - showFieldMsg(String field, String message, String type, Boolean scrollForm)</a> methods to display messages on a form.</p> <div class="p">For example, the following code snippet shows how to display two messages on the <code class="ph codeph">work_notes</code> field of a form and then hide the first message: <pre class="pre codeblock"><code>g_form.showFieldMsg('work_notes', 'First message', "error"); g_form.showFieldMsg('work_notes', 'Second message', "error"); g_form.hideFieldMsg('work_notes', false); // This call hides the 'First message'</code></pre></div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideFieldMsg_String__table_xnf_3pw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 75. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5477">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5480">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5483">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5477 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5480 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5483 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5477 ">clearAll</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5480 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5483 ">Optional. Flag that indicates whether to hide all messages for the specified field.<div class="p">Valid values:<ul class="ul"><li class="li">true: Hide all messages.</li><li class="li">false: Only hide the first message being displayed.</li></ul> </div> <p class="p">Default: false</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideFieldMsg_String__table_ynf_3pw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 76. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5544">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5547">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5544 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5547 "> </td></tr></tbody></table> </div> </div> <div class="example" id="r_GlideFormHideFieldMsg_String__example_fx1_spf_gcc"> <p class="p">The following example shows how to clear all messages for a specified form field and then display an encryption error message.</p> <pre class="pre codeblock"><code>function submitEncryptedInputs() { return processEncryptedInputs(function(inputName, fieldName) { if (!checkEncryptedFieldValue(fieldName)) { g_form.hideFieldMsg(fieldName, true); // Hide all messages for the specified field g_form.showFieldMsg(fieldName, "Your activity requires an encrypted input.", "error"); return false; } return true; }); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormHideRelatedList_String"> <h2 class="title topictitle2" id="ariaid-title40">GlideForm - hideRelatedList(String listTableName)</h2> <div class="body refbody"><p class="shortdesc">Hides the specified related list on the form.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideRelatedList_String__table_syn_wqw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 77. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5639">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5642">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5645">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5639 ">listTableName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5642 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5645 ">Name of the related list. Use the sys_id to hide a list through a relationship.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideRelatedList_String__table_tyn_wqw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 78. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5682">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5685">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5682 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5685 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormHideRelatedLists"> <h2 class="title topictitle2" id="ariaid-title41">GlideForm - hideRelatedLists()</h2> <div class="body refbody"><p class="shortdesc">Hides all related lists on the form.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideRelatedLists__table_zmg_jrw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 79. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5767">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5770">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5773">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5767 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5770 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5773 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormHideRelatedLists__table_ang_jrw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 80. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5808">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5811">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5808 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5811 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-isLiveUpdating"> <h2 class="title topictitle2" id="ariaid-title42">GlideForm - isLiveUpdating()</h2> <div class="body refbody"><p class="shortdesc">Returns true while a live update is being done on the record the form is showing.</p> <div class="section"> <p class="p">This can be used in an <span class="keyword apiname">onChange()</span> client script to determine if a change to the record is because of a live update from another session. The client script can then decide what action to take, or not to take. This applies to systems using <span class="ph">Core UI</span> with live forms enabled.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-isLiveUpdating__table_fjz_sks_kx" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 81. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5900">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5903">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5906">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5900 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5903 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5906 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-isLiveUpdating__table_gjz_sks_kx" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 82. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5941">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e5944">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5941 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e5944 ">Returns true if a live update is happening on the record displayed by the form.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormIsMandatory_String"> <h2 class="title topictitle2" id="ariaid-title43">GlideForm - isMandatory(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">Returns true if the field is mandatory.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormIsMandatory_String__table_kpt_nnc_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 83. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6024">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6027">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6030">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6024 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6027 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6030 ">Name of the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormIsMandatory_String__table_lpt_nnc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 84. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6067">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6070">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6067 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6070 ">True if the field is required, false otherwise.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormIsNewRecord"> <h2 class="title topictitle2" id="ariaid-title44">GlideForm - isNewRecord()</h2> <div class="body refbody"><p class="shortdesc">Returns true if the record has never been saved.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormIsNewRecord__table_wlm_wmd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 85. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6151">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6154">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6157">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6151 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6154 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6157 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormIsNewRecord__table_xlm_wmd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 86. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6192">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6195">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6192 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6195 ">Returns true if the record has not been saved; otherwise false.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onLoad() { if(g_form.isNewRecord()){ alert('New Record!'); } }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormIsSectionVisible_String"> <h2 class="title topictitle2" id="ariaid-title45">GlideForm - isSectionVisible(String sectionName)</h2> <div class="body refbody"><p class="shortdesc">Returns true if the section is visible.</p> <div class="section"> <div class="note important"><span class="importanttitle">Important:</span> The isSectionVisible() function is not supported in Workspace.</div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormIsSectionVisible_String__table_msy_jnd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 87. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6284">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6287">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6290">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6284 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6287 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6290 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormIsSectionVisible_String__table_nsy_jnd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 88. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6325">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6328">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6325 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6328 ">Returns true when the section is visible; otherwise, false is returned.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-onUserChangeValue_F"> <h2 class="title topictitle2" id="ariaid-title46">GlideForm - onUserChangeValue(Function fn)</h2> <div class="body refbody"><p class="shortdesc">Registers a custom event listener that detects when any field in the current form is modified by a user.</p> <div class="section"> <p class="p">When a form field is modified, the event listener calls the function that is passed in when the listener is initially registered. This listener is only triggered when a user makes a change to a field on the form. Changes from client scripts, UI policies, or any other non-user interactions, do not trigger the listener.</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> This method does not work for journal fields or <span class="ph">Service Catalog</span> items in the classic environment.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-onUserChangeValue_F__table_m5y_wll_1hb" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 89. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6419">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6422">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6425">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6419 ">fn</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6422 ">Function</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6425 ">Function to call when a user changes the value of a field within the current form. This is actually the function code, not just the function name. <p class="p">This function must accept the following three arguments:</p> <ul class="ul" id="GF-onUserChangeValue_F__ul_fnz_j4l_1hb"><li class="li">field name</li><li class="li">original field value</li><li class="li">updated field value</li></ul> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-onUserChangeValue_F__table_n5y_wll_1hb" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 90. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6476">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6479">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6476 ">Function</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6479 ">Function to call to unregister the onUserChangeValue event listener.</td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>var handler = function(fieldname, originalValue, newValue) { console.log('The field ('+ fieldname + ') has a new value of: ' + newValue); // function code } var unregister = g_form.onUserChangeValue(handler); // To unregister the event listener unregister();</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-refreshSlushbucket_S"> <h2 class="title topictitle2" id="ariaid-title47">GlideForm - refreshSlushbucket(String fieldName)</h2> <div class="body refbody"><p class="shortdesc">You can update a list collector variable.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-refreshSlushbucket_S__table_n3v_plp_cv" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 91. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6565">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6568">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6571">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6565 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6568 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6571 ">Name of the slush bucket.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-refreshSlushbucket_S__table_o3v_plp_cv" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 92. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6608">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6611">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6608 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6611 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.refreshSlushbucket('bucket');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-RemoveDecoration_S_S_S"> <h2 class="title topictitle2" id="ariaid-title48">GlideForm - removeDecoration(String fieldname, String icon, String title)</h2> <div class="body refbody"><p class="shortdesc">Removes the icon from the specified field that matches the icon and title.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> This method is not supported by Service Catalog.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-RemoveDecoration_S_S_S__table_x23_vrw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 93. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6701">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6704">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6707">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6701 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6704 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6707 ">Field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6701 ">icon</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6704 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6707 ">Name of the icon to remove.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6701 ">title</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6704 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6707 ">The icon's text title (name).</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-RemoveDecoration_S_S_S__table_y23_vrw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 94. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6768">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6771">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6768 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6771 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { // if the caller_id field is not present, then we can't add an icon anywhere if (!g_form.hasField('caller_id')) return; if (!newValue) return; g_form.getReference('caller_id', function(ref) { g_form.removeDecoration('caller_id', 'icon-star', 'VIP'); if (ref.getValue('vip') == 'true') g_form.addDecoration('caller_id', 'icon-star', 'VIP'); }); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-RemoveDecoration_S_S_S_S"> <h2 class="title topictitle2" id="ariaid-title49">GlideForm - removeDecoration(String fieldname, String icon, String title, String color)</h2> <div class="body refbody"><p class="shortdesc">Removes the icon from the specified field that matches the icon, title, and color.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> This method is not supported by Service Catalog.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-RemoveDecoration_S_S_S_S__table_mcg_5zd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 95. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6860">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6863">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6866">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6860 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6863 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6866 ">Field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6860 ">icon</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6863 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6866 ">Name of the icon to remove.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6860 ">title</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6863 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6866 ">The icon's text title (name).</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6860 ">color</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6863 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6866 ">A CSS color</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-RemoveDecoration_S_S_S_S__table_ncg_5zd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 96. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6939">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e6942">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6939 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e6942 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.removeDecoration('caller_id', 'icon-star', 'VIP', 'blue');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormRemoveOption_String_String"> <h2 class="title topictitle2" id="ariaid-title50">GlideForm - removeOption(String fieldName, String choiceValue)</h2> <div class="body refbody"><p class="shortdesc">Removes the specified option from the choice list.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormRemoveOption_String_String__table_p4k_hjd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 97. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7028">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7031">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7034">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7028 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7031 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7034 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7028 ">choiceValue</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7031 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7034 ">The value stored in the database. This is not the label.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormRemoveOption_String_String__table_q4k_hjd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 98. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7083">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7086">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7083 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7086 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.removeOption('priority', '1');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSave"> <h2 class="title topictitle2" id="ariaid-title51">GlideForm - save()</h2> <div class="body refbody"><p class="shortdesc">Saves the record without navigating away (update and stay).</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSave__table_xgb_3qd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 99. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7171">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7174">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7177">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7171 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7174 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7177 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSave__table_ygb_3qd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 100. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7212">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7215">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7212 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7215 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-SetMandatory_S_B"> <h2 class="title topictitle2" id="ariaid-title52">GlideForm - setMandatory(String fieldName, Boolean mandatory)</h2> <div class="body refbody"><p class="shortdesc">Makes the specified field mandatory.</p> <div class="section"> <p class="p">Whenever possible, use a UI policy rather than this method.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-SetMandatory_S_B__table_xnx_z4c_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 101. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7298">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7301">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7304">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7298 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7301 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7304 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7298 ">mandatory</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7301 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7304 ">When true makes the field mandatory. When false makes the field optional.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-SetMandatory_S_B__table_ynx_z4c_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 102. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7353">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7356">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7353 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7356 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-SetSectionDisplay_S_B"> <h2 class="title topictitle2" id="ariaid-title53">GlideForm - setSectionDisplay(String sectionName, Boolean display)</h2> <div class="body refbody"><p class="shortdesc">Shows or hides a section.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-SetSectionDisplay_S_B__table_pqq_qqd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 103. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7435">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7438">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7441">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7435 ">sectionName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7438 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7441 ">The section name is lower case with an underscore replacing the first space in the name, and with the remaining spaces being removed, for example "Section Four is Here" becomes "section_fourishere". Other non-alphanumeric characters, such as ampersand (&), are removed. Section names can be found by using the <span class="keyword apiname">getSectionNames()</span> method.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7435 ">display</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7438 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7441 ">When true shows the section. When false hides the section.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-SetSectionDisplay_S_B__table_qqq_qqd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 104. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7493">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7496">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7493 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7496 ">Returns true when successful.</td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideForm-SetValue_S_S_S"> <h2 class="title topictitle2" id="ariaid-title54">GlideForm - setValue(String fieldName, String value, String displayValue)</h2> <div class="body refbody"><p class="shortdesc">Sets the value of a specified form field to the value of a specified display value in a reference record.</p> <div class="section"> <p class="p">To improve performance by preventing a round trip when setting the value for a reference field, use this method, not <span class="keyword apiname">setValue(fieldName, value)</span>. When setting multiple reference values for a list collector field, pass arrays in the <span class="keyword parmname">value</span> and <span class="keyword parmname">displayValue</span> parameters.</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> The method <span class="keyword apiname">setValue()</span> can cause a stack overflow when used in an OnChange client script. This is because every time the value is set, it will register as a change, which may re-trigger the OnChange client script. To prevent this, perform a check that will validate that the new value will be different from the old value. For example, before performing <code class="ph codeph">setValue(shortDesc, newValue.toUpperCase());</code>, validate that the short description is not already uppercase. This will prevent the client script from applying the <span class="keyword apiname">toUpperCase()</span> more than once.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-SetValue_S_S_S__table_oxn_vrc_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 105. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7602">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7605">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7608">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7602 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7605 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7608 ">Name of the form field to update.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7602 ">value</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7605 ">String or Array</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7608 ">Sys_id of the reference record to use to update the field.<p class="p">If the specified field is a GlideList, this parameter can contain an array of sys_ids. In this case, the method performs a lookup of all records specified in the array and those values are used to update the contents of the specified field (related list).</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> When defining a value in a choice list, be sure to use number value rather than the label.</div> </div> </td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7602 ">displayValue</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7605 ">String or Array</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7608 ">Field within the specified reference record to use to update the specified field. For example, in the User [sys_user] table it might be userName.<p class="p">If the specified field is a GlideList, this parameter can contain an array of display value names.</p> <p class="p">For additional information on display values, see <a class="xref" href="../administer/field-administration/concept/c_DisplayValues.dita/c_DisplayValues.html" target="_blank" rel="noopener noreferrer">Display value</a>.</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideForm-SetValue_S_S_S__table_pxn_vrc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 106. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7684">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7687">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7684 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7687 "> </td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">This example shows passing the sys_id of the reference record that contains the userName field to use to update the <span class="ph uicontrol">assigned_to</span> form field.</p> <pre class="pre codeblock"><code>g_form.setValue('assigned_to', userSysID, userName);</code></pre> </div> <div class="example"> <p class="p">This example shows passing an array of reference record sys_ids and an array of corresponding display value names to use to update the form fields in the GlideList <span class="ph uicontrol">glide-list_field_name</span>.</p> <pre class="pre codeblock"><code>g_form.setValue('glide-list_field_name', sysIDArray, displayNameArray);</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-ShowErrorBox_S_S_B"> <h2 class="title topictitle2" id="ariaid-title55">GlideForm - showErrorBox(String name, String message, Boolean scrollForm)</h2> <div class="body refbody"><p class="shortdesc">Displays an error message under the specified form field (either a control object or the name of the field). If the control or field is currently off the screen and the scrollForm parameter is true, the form scrolls to the control or field.</p> <div class="section"> <p class="p">A global property (glide.ui.scroll_to_message_field) is available that controls automatic message scrolling when the form field is off screen (scrolls the form to the control or field). The <span class="keyword apiname">showFieldMsg()</span> method is a similar method that requires a type parameter.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-ShowErrorBox_S_S_B__table_lyr_dww_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 107. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7796">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7799">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7802">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7796 ">name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7799 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7802 ">Name of the field or control.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7796 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7799 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7802 ">Message to display.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7796 ">scrollForm</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7799 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7802 ">When true scrolls the form to the field. When false the form does not scroll to the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-ShowErrorBox_S_S_B__table_myr_dww_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 108. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7863">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7866">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7863 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7866 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-ShowFieldMsg_S_S_S"> <h2 class="title topictitle2" id="ariaid-title56">GlideForm - showFieldMsg(String field, String message, String type)</h2> <div class="body refbody"><p class="shortdesc">Displays either an informational or error message under the specified form field (either a control object or the name of the field). If the control or field is off the screen, the form is scrolled to the field.</p> <div class="section"> <p class="p">A global property (glide.ui.scroll_to_message_field) is available that controls automatic message scrolling when the form field is off screen (scrolls the form to the control or field).</p> <p class="p">The <span class="keyword apiname">showErrorBox()</span> method is a shorthand method that does not require the type parameter.</p> <div class="note"><span class="notetitle">Note:</span> This method does not work with the <span class="keyword parmname">journal_field</span> type field in <span class="ph">Core UI</span>.</div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-ShowFieldMsg_S_S_S__table_u3z_hxw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 109. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7964">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7967">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e7970">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7964 ">field</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7967 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7970 ">Name of the field or control.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7964 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7967 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7970 ">Message to display.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7964 ">type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7967 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e7970 ">"error","info", or "warning".</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-ShowFieldMsg_S_S_S__table_v3z_hxw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 110. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8031">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8034">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8031 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8034 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.showFieldMsg('impact','Low impact response time can be one week','info');</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GF-ShowFieldMsg_S_S_S_B"> <h2 class="title topictitle2" id="ariaid-title57">GlideForm - showFieldMsg(String field, String message, String type, Boolean scrollForm)</h2> <div class="body refbody"><p class="shortdesc">Displays either an informational or error message under the specified form field (either a control object or the name of the field). If the control or field is currently off the screen and scrollForm is true, the form is scrolled to the field.</p> <div class="section"> <p class="p">A global property (glide.ui.scroll_to_message_field) is available that controls automatic message scrolling when the form field is off screen (scrolls the form to the control or field).</p> <p class="p">The <span class="keyword apiname">showErrorBox()</span> method is a shorthand method that does not require the type parameter.</p> <div class="note"><span class="notetitle">Note:</span> This method does not work with the <span class="keyword parmname">journal_field</span> type field in <span class="ph">Core UI</span>.</div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-ShowFieldMsg_S_S_S_B__table_wmr_gyw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 111. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8137">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8140">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8143">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8137 ">field</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8140 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8143 ">Name of the field or control.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8137 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8140 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8143 ">Message to display.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8137 ">type</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8140 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8143 ">"error","info", or "warning".</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8137 ">scrollForm</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8140 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8143 ">When true, the form scrolls to the field if it is off screen. When false, the form does not scroll.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GF-ShowFieldMsg_S_S_S_B__table_xmr_gyw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 112. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8216">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8219">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8216 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8219 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>g_form.showFieldMsg('impact','Low impact not allowed with High priority','error',false);</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSetDisabled_String_Boolean"> <h2 class="title topictitle2" id="ariaid-title58">GlideForm - setDisabled(String fieldName, Boolean disable)</h2> <div class="body refbody"><p class="shortdesc">Makes the specified field available or unavailable.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetDisabled_String_Boolean__table_sn2_j4c_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 113. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8305">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8308">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8311">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8305 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8308 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8311 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8305 ">disable</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8308 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8311 ">When true disables the field. When false enables the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetDisabled_String_Boolean__table_tn2_j4c_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 114. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8360">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8363">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8360 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8363 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSetDisplay_String_Boolean"> <h2 class="title topictitle2" id="ariaid-title59">GlideForm - setDisplay(String fieldName, Boolean display)</h2> <div class="body refbody"><p class="shortdesc">Displays or hides a field.</p> <div class="section"> <p class="p">This method cannot hide a mandatory field with no value. If the field is hidden, the space is used to display other items. Whenever possible, use a UI policy instead of this method.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetDisplay_String_Boolean__table_k4d_ctw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 115. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8445">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8448">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8451">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8445 ">fieldname</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8448 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8451 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8445 ">display</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8448 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8451 ">When true displays the field, when false hides the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetDisplay_String_Boolean__table_l4d_ctw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 116. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8500">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8503">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8500 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8503 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading, isTemplate) { //If the page isn't loading if (!isLoading) { //If the new value isn't blank if (newValue != '') { g_form.setDisplay('priority', false); } else g_form.setDisplay('priority', true); } }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSetLabelOf_String_String"> <h2 class="title topictitle2" id="ariaid-title60">GlideForm - setLabelOf(String fieldName, String label)</h2> <div class="body refbody"><p class="shortdesc">Sets the plain text value of the field label.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> This method is not supported by Service Catalog.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetLabelOf_String_String__table_h5q_ytw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 117. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8593">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8596">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8599">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8593 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8596 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8599 ">The field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8593 ">label</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8596 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8599 ">The field text label.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetLabelOf_String_String__table_i5q_ytw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 118. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8648">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8651">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8648 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8651 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>if (g_user.hasRole('itil')) { var oldLabel = g_form.getLabelOf('comments'); g_form.setLabelOf('comments', oldLabel + ' (Customer visible)'); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSetReadOnly_String_Boolean"> <h2 class="title topictitle2" id="ariaid-title61">GlideForm - setReadOnly(String fieldName, Boolean readOnly)</h2> <div class="body refbody"><p class="shortdesc">Makes the specified field read-only or editable.</p> <div class="section"> <p class="p">Whenever possible, use a UI policy instead of this method.</p> <p class="p">To make a mandatory field read-only, you must first remove the mandatory requirement for that field by using the <span class="keyword apiname">setMandatory()</span> method.</p> <p class="p">Once you set a field to read-only, you cannot use the <a class="xref" href="c_GlideFormAPI.html#r_GlideFormSetValue_String_String" title="Sets the value of a specified form field to the passed in value.">setValue()</a> method to update the value of that field. If you need to set the value in this way, you must set the readOnly value to false.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetReadOnly_String_Boolean__table_xdf_qpc_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 119. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8755">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8758">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8761">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8755 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8758 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8761 ">Name of the field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8755 ">readOnly</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8758 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8761 ">Flag that determines whether the associate field is editable or read-only.<div class="p">Possible values:<ul class="ul" id="r_GlideFormSetReadOnly_String_Boolean__ul_ah1_bkw_yqb"><li class="li">true: Set field to read-only</li><li class="li">false: Set field to be editable</li></ul> </div> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetReadOnly_String_Boolean__table_ydf_qpc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 120. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8820">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8823">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8820 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8823 "> </td></tr></tbody></table> </div> </div> <div class="example" id="r_GlideFormSetReadOnly_String_Boolean__example_rgd_ddh_45b"> <p class="p">The following example shows how set the Variable Editor to read only. To do this in <span class="ph">Service Catalog</span> tables, use <span class="keyword apiname">setVariablesReadOnly()</span>.</p> <pre class="pre codeblock"><code>// Create a Client Script on a table (e.g., incident) and paste this script // Uncheck (set to false) the "isolate script" checkbox (not available by default) // To add the isolate script checkbox to the form, configure form layout to add the checkbox function onLoad() { $("variable_map").querySelectorAll("item").forEach(function(item){ var variable = item.getAttribute("qname"); g_form.setReadOnly("variables."+ variable, true); }); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSetValue_String_String"> <h2 class="title topictitle2" id="ariaid-title62">GlideForm - setValue(String fieldName, String value)</h2> <div class="body refbody"><p class="shortdesc">Sets the value of a specified form field to the passed in value.</p> <div class="section"> <p class="p">This method also supports setting values in a multi-row variable set (MRVS). You must first use <code class="ph codeph">JSON.parse(getValue('<mrvs_field_name>'))</code> 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 <span class="keyword apiname">setValue()</span> method to save the updated MRVS array. For more details, see the code example below.</p> <div class="p"><div class="note"><span class="notetitle">Note:</span> The method <span class="keyword apiname">setValue()</span> can cause a stack overflow when used in an OnChange client script. This is because every time the value is set, it will register as a change, which may re-trigger the OnChange client script. To prevent this, perform a check that will validate that the new value will be different from the old value. For example, before performing <code class="ph codeph">setValue(shortDesc, newValue.toUpperCase());</code>, validate that the short description is not already uppercase. This will prevent the client script from applying the <span class="keyword apiname">toUpperCase()</span> more than once.</div> <div class="note"><span class="notetitle">Note:</span> When defining a value in a choice list, be sure to use the number value rather than the label.</div> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetValue_String_String__table_bqz_pqc_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 121. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8943">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8946">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8949">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8943 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8946 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8949 ">Name of the form field to update.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8943 ">value</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8946 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8949 ">String value to set in the specified field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetValue_String_String__table_cqz_pqc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 122. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e8998">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9001">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e8998 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9001 "> </td></tr></tbody></table> </div> </div> <div class="example"> <p class="p">The following example shows how to set the short description in the current form.</p> <pre class="pre codeblock"><code>g_form.setValue('short_description', 'replace this with appropriate text');</code></pre> </div> <div class="example"> <p class="p">The following example shows how to set values in an MRVS. In this example, salaries are being managed through the Service Catalog. The client script searches all rows within the MRVS for the value entered in the <span class="ph uicontrol">Job title</span> and then updates the matching entries within the MRVS with what is entered in the <span class="ph uicontrol">Salary</span> field. The MRVS is named "variable_set_1" and contains the following fields within each row object: Employee name [employee_name], Job title [employee_job_title], and Salary [employee_salary]. In addition, the Catalog Item contains: Job title [job_title] and Salary [salary].</p> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } // Get the MRVS var multiRowVariableSet = JSON.parse(g_form.getValue('variable_set_1')); for (var i = 0; i < multiRowVariableSet.length; i++) { // Check if the entered job title matches the title in the current MRVS row if (multiRowVariableSet[i].employee_job_title == g_form.getValue("job_title")){ // Update the value of a matching field with the new salary multiRowVariableSet[i].employee_salary = newValue; } } // Update the MRVS g_form.setValue('variable_set_1', JSON.stringify(multiRowVariableSet)); }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-setVariablesReadOnly_B"> <h2 class="title topictitle2" id="ariaid-title63">GlideForm - setVariablesReadOnly(Boolean isReadOnly)</h2> <div class="body refbody"><p class="shortdesc">Makes a <span class="ph">Service Catalog</span> variable editor read only.</p> <div class="section"> <div class="p"><div class="note"><span class="notetitle">Note:</span> This method is only applicable to <span class="ph">Service Catalog</span> variable editors in the core UI. This method is not supported in the <span class="ph">Service Catalog</span> form.</div> </div> <p class="p">The method must be placed in the client script of the table in which the variable editor is added, such as Requested Item [sc_req_item], Incident [incident], and so on. To set variables to read only in other tables, use the <a class="xref" href="c_GlideFormAPI.html#r_GlideFormSetReadOnly_String_Boolean" title="Makes the specified field read-only or editable.">setReadOnly()</a> method.</p> <p class="p">See also: <a class="xref" href="../product/service-catalog-management/concept/service-catalog-variable-editor.dita/service-catalog-variable-editor.html" target="_blank" rel="noopener noreferrer">Service Catalog variable editors</a></p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-setVariablesReadOnly_B__table_xdf_qpc_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 123. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9121">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9124">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9127">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9121 ">isReadOnly</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9124 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9127 ">Flag that determines whether the variable editor is read only.<div class="p">Possible values:<ul class="ul" id="GF-setVariablesReadOnly_B__ul_ah1_bkw_yqb"><li class="li">true: Sets the variable editor as read-only.</li><li class="li">false: Sets the variable editor as editable.</li></ul> </div> <p class="p">Default: false</p> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-setVariablesReadOnly_B__table_ydf_qpc_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 124. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9177">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9180">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9177 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9180 "> </td></tr></tbody></table> </div> </div> <div class="example" id="GF-setVariablesReadOnly_B__example_rgd_ddh_45b"> <p class="p">Adding the following line to a client script sets the variable editor to read only.</p> <pre class="pre codeblock"><code>g_form.setVariablesReadOnly(true);</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSetVisible_String_Boolean"> <h2 class="title topictitle2" id="ariaid-title64">GlideForm - setVisible(String fieldName, Boolean display)</h2> <div class="body refbody"><p class="shortdesc">Displays or hides the field.</p> <div class="section"> <p class="p">On desktop UI, the space is left blank when hidden. On Mobile or Service Portal UI, the space is filled in my other fields when hidden. This method cannot hide mandatory fields with no value.</p> <p class="p">Use UI Policy rather than this method whenever possible.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetVisible_String_Boolean__table_k24_45w_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 125. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9275">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9278">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9281">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9275 ">fieldName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9278 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9281 ">The field name.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9275 ">display</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9278 ">Boolean</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9281 ">When true displays the field. When false hides the field.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSetVisible_String_Boolean__table_l24_45w_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 126. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9330">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9333">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9330 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9333 "> </td></tr></tbody></table> </div> </div> <div class="example"> <pre class="pre codeblock"><code>function onChange(control, oldValue, newValue, isLoading, isTemplate) { //If the page isn't loading if (!isLoading) { //If the new value isn't blank if(newValue != '') { g_form.setVisible('priority', false); } else g_form.setVisible('priority', true); } }</code></pre> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormShowErrorBox_String_String"> <h2 class="title topictitle2" id="ariaid-title65">GlideForm - showErrorBox(String name, String message)</h2> <div class="body refbody"><p class="shortdesc">Displays an error message under the specified form field (either a control object or the name of the field). If the control or field is currently off the screen, the form scrolls to the control or field.</p> <div class="section"> <p class="p">A global property (glide.ui.scroll_to_message_field) is available that controls automatic message scrolling when the form field is off screen (scrolls the form to the control or field). The <span class="keyword apiname">showFieldMsg()</span> method is a similar method that requires a type parameter.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormShowErrorBox_String_String__table_rxv_2vw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 127. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9424">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9427">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9430">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9424 ">name</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9427 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9430 ">The name of the control or field.</td></tr><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9424 ">message</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9427 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9430 ">The message to be displayed.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormShowErrorBox_String_String__table_sxv_2vw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 128. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9479">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9482">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9479 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9482 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormShowRelatedList_String"> <h2 class="title topictitle2" id="ariaid-title66">GlideForm - showRelatedList(String listTableName)</h2> <div class="body refbody"><p class="shortdesc">Displays the specified related list on the form.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormShowRelatedList_String__table_mps_2zw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 129. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9565">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9568">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9571">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9565 ">listTableName</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9568 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9571 ">Name of the related list.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormShowRelatedList_String__table_nps_2zw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 130. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9608">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9611">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9608 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9611 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormShowRelatedLists"> <h2 class="title topictitle2" id="ariaid-title67">GlideForm - showRelatedLists()</h2> <div class="body refbody"><p class="shortdesc">Displays all the form's related lists.</p> <div class="section"> <p class="p">This method is not available on the mobile platform. If this method is run on a mobile platform, no action occurs.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormShowRelatedLists__table_jcj_rzw_ts" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 131. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9693">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9696">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9699">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9693 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9696 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9699 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormShowRelatedLists__table_kcj_rzw_ts" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 132. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9734">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9737">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9734 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9737 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="r_GlideFormSubmit"> <h2 class="title topictitle2" id="ariaid-title68">GlideForm - submit()</h2> <div class="body refbody"><p class="shortdesc">Saves the record.</p> <div class="section"> <p class="p">The user is taken away from the form, returning them to where they were.</p> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSubmit__table_nhk_grd_5s" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 133. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9820">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9823">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9826">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9820 ">None</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9823 "> </td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9826 "> </td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="r_GlideFormSubmit__table_ohk_grd_5s" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 134. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9861">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9864">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9861 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9864 "> </td></tr></tbody></table> </div> </div> </div> </div> <div class="topic reference nested1 api-method" id="GF-submit_S"> <h2 class="title topictitle2" id="ariaid-title69">GlideForm - submit(String verb)</h2> <div class="body refbody"><p class="shortdesc">Performs the UI action specified by the parameter.</p> <div class="section"> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-submit_S__table_o1z_d3p_qx" class="table parameters" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 135. </span>Parameters</span></caption><colgroup><col /><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9943">Name</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9946">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9949">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9943 ">verb</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9946 ">String</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9949 ">An action_name from a sys_ui_action record. The action name must be for a visible form button.</td></tr></tbody></table> </div> <div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="GF-submit_S__table_p1z_d3p_qx" class="table returns" frame="border" border="1" rules="all"><caption><span class="tablecap"><span class="table--title-label">Table 136. </span>Returns</span></caption><colgroup><col /><col /></colgroup><thead class="thead" style="text-align:left;"><tr class="row"><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9986">Type</th><th class="entry cellrowborder" style="vertical-align:top;" id="d1408670e9989">Description</th></tr></thead><tbody class="tbody"><tr class="row"><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9986 ">void</td><td class="entry cellrowborder" style="vertical-align:top;" headers="d1408670e9989 "> </td></tr></tbody></table> </div> </div> </div> </div> </div> </body></html></div>