What are those things that does not supported in Service Portal related to Catalog?

Kunal Varkhede
Tera Guru

What is not supported in Service Portal?

3 REPLIES 3

Omkar Mone
Mega Sage

Hi Kunal,

 

If you create a UI Page Variable it will not be seen on Service Portal as Portal does not support the Jelly Scripts.

The client script which are on Desktop type wont work on portal but will only work on desktop view for the catalog item.

getxmlwait in GlideAjax wont work on Portal.

DOM manipulations in client script would give error on Portal.

Check the below link for further details.

https://community.servicenow.com/community?id=community_question&sys_id=227c0ba5db9cdbc01dcaf3231f96...

 

Regards,

Omkar Mone

Harsh Vardhan
Giga Patron

Unsupported client scripting globals

Widget client controllers are full Angular controllers and are not subject to the unsupported client script globals listed here. Use jQuery and Angular as needed.

The following globals and APIs are unavailable in client scripts and catalog client scripts used in the Service Portal:

  • $
  • $$
  • $j
  • angular
  • control
  • document
  • jQuery
  • window

Embedded widgets & g_form

When using the Service Catalog variable type Macro and Macro with Label, you can pick a widget to embed in a catalog item form. Within the client controller for the embedded widget you can access the field object and catalog item g_form instance using:

  • $scope.page.field
  • $scope.page.g_form()

Example: g_list and g_service_catalog in client scripts used with Service Portal

The g_list global helps you set the filter of a Glide list element or a list collector variable. Use this API in place of the g_filter API on desktop client scripts.
function onLoad() {
  var myListCollector = g_list.get("my_list_collector");
  myListCollector.reset();
  myListCollector.setQuery("active=true^category=8c7b22230b402200b0b02c6317673a62");
  myListCollector.addItem('3a700d39af5f4fc0aab978df90f4c692', 'Power Supply');
  myListCollector.addItem('1cb93419a3a248318da8f814140b42f6', 'Backpack');
}
g_service_catalog is only available in Service Portal service catalog item scripts. Use this API to know if your catalog item script is run as part of an order guide or on its own.
function onLoad() {
  if (window) // if CMS, don't run this
   return;

   // g_service_catalog api for Service Portal and Mobile
   var isOrderGuide = g_service_catalog.isOrderGuide();
   g_form.setValue("is_order_guide", isOrderGuide ? "Yes!" : "Nope :(");
}
 

AbhishekGardade
Giga Sage

Hello Kunal,

Check out this link for unsuppored API, script in portal

https://serviceportal.io/docs/documentation/client_scripting.md

Six common performance pitfalls in Service Portal and how to diagnose them

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade