g_form.getReference() and Service Portal

Community Alums
Not applicable

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:

find_real_file.png

Here it is in SP:

find_real_file.png

We have another form which uses containers, but not variable sets to store the variables, and that seems to be displaying properly.

Cheers,

Tim

3 REPLIES 3

mrswann
Kilo Guru

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


Community Alums
Not applicable

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


Community Alums
Not applicable

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