g_form.getReference() and Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 12:48 PM
Does this not work in ServicePortal? I am doing a GlideAjax call in a catalogue client script to check the current catalog item and change the label of one of the variables (within a variable set).
Here is the code:
var catItemID = g_form.getParameter('sysparm_id');
var ga = new GlideAjax('GrahamAjaxUtils');
ga.addParam('sysparm_name','getCatItemName');
ga.addParam('sysparm_cat_item_id', catItemID);
ga.getXML(switchLabel);
It works fine within ServiceNow, but not in the Service Portal (just ignores the script, field label does not change).
Also, does anyone have any experience with Variable Sets and Service Portal? The forms I have which use containers in variable sets seem to be ignoring the containers. As an example, this is what the form looks like within Service Now:
Here it is in SP:
We have another form which uses containers, but not variable sets to store the variables, and that seems to be displaying properly.
Cheers,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 01:08 PM
I have read some bits about client scripts in helsinki and maybe service portal worth doing a few searches on here in last week or so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 01:12 PM
Thanks mrswann. I just found this, which seems to answer my first question:
Mobile Client GlideForm (g form) Scripting - ServiceNow Wiki
getParameter is not supported in mobile platform.
Cheers,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2016 02:35 PM
Looks like the other issue I mentioned has been turned into a problem (PRB682246 - service portal ignores multiple column variable layouts in catalog).
Hopefully a fix in the next patch!
Cheers,
Tim