- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 03:09 AM
Hi All,
in Madarid, i had a g_form method named getEditableFields() , but now I am trying to write the script in NewYork but this method is not available... Is it correct or I am doing something wrong. Please help!!
Script in Madarid:
var stat=g_form.getValue('state');
if(stat =='8' || stat=='10' || stat== '11'){
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
Regards,
Shivani Malhan
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- 6,061 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 03:14 AM
You doing it correctly. Its normal behavior. g_form wont show you this method getEditableFields().
EDIT:
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.
Note: This doesn't work 100% of the time:
Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 03:14 AM
You doing it correctly. Its normal behavior. g_form wont show you this method getEditableFields().
EDIT:
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.
Note: This doesn't work 100% of the time:
Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 03:26 AM
Hi Abhishek,
Thanks for the prompt response. I tested and working.
Regards,
Shivani Malhan