tiagomacul
Giga Sage
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-21-2020 07:16 AM
client Script set all fields to Mandatory & Visible
UI Action / UI Policy
//For to set mandatory false (campos como - não obrigatório)
for (var i = 0; i < g_form.elements.length; i++)
{
var el = g_form.elements[i];
var fieldName = el.fieldName;
g_form.setMandatory(fieldName, false);
}
- 4,582 Views
Comments
Ashley Snyder1
Giga Guru
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
08-21-2020
07:44 AM
Is this a question?
UI Policies are the recommend method of setting fields to mandatory/visible/etc. rather than Client Scripts per ServiceNow best practice.
"When possible, consider using a UI Policy to set field attributes to mandatory, read-only, or visible. No scripting is required to set field attributes in UI Policies."