
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2018 03:48 AM
Can I use the g_form methods in the UI Policy scripts?
function onCondition()
{
var fields = g_form.getEditableFields();
for(var x = 0; x < fields.length; x++)
{
g_form.setReadOnly(fields[x],true);
}
}
If yes, will this code get executed in the UI Policy?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2018 05:38 AM
Hello,
Yes, g_form works well in UI Policy. If you try above code, the form should be readonly atleast in Application View.
Best Regards,
Jai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2018 05:38 AM
Hello,
Yes, g_form works well in UI Policy. If you try above code, the form should be readonly atleast in Application View.
Best Regards,
Jai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2018 05:40 AM
Hello,
To add to my comment, above-mentioned function getEditableFields is not supported in Service Portal.
Best Regards,
Jaikumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2018 11:25 AM
Hi Anish,
yes we can use this script in UI policy. I tried this on incident form and it works.