getEditableFields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016 07:14 AM
Where is this method in the wiki page? I got this from here Make all form fields read-only (client script)
http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016 11:51 AM
What do you need to do?
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016 12:48 PM
ServiceNow doesn't include everything in their documentation for some reason or another. Maybe they know they might change a functionality or something. Who knows except for them. However, it doesn't mean that that information isn't available.
If you definitely know of a function or method exists and there is no documentation on it, sometimes you can render a form or a ServiceNow page and use the "Inspect element" of the browser tools to gather some info.
Below you'll see some screenshots of steps to take using the console to find some data on the g_form.getEditableFields method.
Note: This doesn't work 100% of the time:
Above you can see a list of some available methods on g_form when I started to type "g_form."
Above, I chose the g_form.getEditableFields and left off the parentheses so that the console would just print what the method contains. However, the function was too long to display all of it so the console cut it short. Sometimes you can right click on it and if available it will pull up the file that contains the full script. But in this case it didn't so I used the ".toString()" method to see if it would print out the function. Note that parentheses were not included on the ".getEditableFields" again as to not execute it.
Finally below I used the parentheses to see what the method does and I can see it returns an array of the field names that are editable. Also notice that the method does not take any parameter/argument.
I hope that helps.