g_form.getValue returning blank in Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2019 01:39 PM
I have two issues an onLoad client script that functions on the regular form but returns blank in the ServicePortal.
UI Type: All
Type: onLoad
function onLoad() {
g_form.setMandatory('short_description',false);
}
This works on the IDE forms, but does not work on the Form widget.
UI Type: All
Type: onLoad
function onLoad() {
var test = g_form.getValue('short_description');
alert(test);
}
This also works fine on the IDE forms, but does not work on the Form widget.
This is a scoped table and a global widget... I do not know if that matters.
Also, g_form.getSysId() works in both, so some g_form functionality works and others do not. There are a number of other posts about the same issue, so any insight would be appreciated.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2019 04:01 PM
This seems to be a relatively common Service Portal issue across Kingston and Helsinki Form Widget versions, but I was unable to find a post of it having happened in London. Two of the fixes I have seen:
1. DOM Manipulation...a bit of a "no no"
2. Applying a patch that fixes the issue. It is referenced in one of the above posts, but again, that was an instance run on Helsinki.
If this is indeed a bug, which it might be, could you use GlideAjax or a GlideRecord to access the value? It depends on your use case, but this issue seems specific to the Service Portal's Form Widget.
I wish I could offer more insight, and having just gotten into the Service Portal, am quite interested in finding a sustainable solution.
Cheers