Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Catalog Client Scripts not working in Service Portal

spinol611
Giga Contributor

Hello,

I'm currently trying to move over from the CMS sites to Service Portal. One of the issues that I'm running into is having Catalog Client Scripts not functioning AT ALL in Service Portal. All of my catalog items are marked "Desktop and Mobile" and the UI type on the Scripts are set to "All." I know that some of the g_form don't function on the mobile UI, but I can't even get g_form.setReadOnly to work on Service Portal. My instance is currently running Instanbul patch 0.

Any help is greatly appreciated!

3 REPLIES 3

BALAJI40
Mega Sage

Hi Stephen,



Catalog client scripts will work in service portal, if any problem are there you need to customize them.


main point it should work in portal,ui type should be both.


This is link which will help you, in this it shows the supported and unsupported features are documented


GitHub - service-portal/documentation: Here you will find unofficial documentation for the ServiceNo...


Nithin12
Tera Expert

Hi Stephen,



There are various things which doesn't work on service portal.


Few things you need to check befor writing a catalog client script that run on service portal are:


1.You need to use only mobile API's   or function's mentioned   in Servcie Portal API's .


2.In service portal only asynchronous functions will work, even for simple Glide Record calls you need to use call back functions.


3.you need to be careful while using on submit script if you have any data validations from server side , As it is asynchronous it does't wait for validations.


4.UI macros and UI Pages can't be accessed in Service portal, Insted you need to use widgets (which can be called as catalog item variables).


5.DOM manipulations will not work.



When coming to trouble shooting, just inspect the webpage in source tab you will get errors , so that you can easily find which method or script is giving trouble .




Thanks,


Nithin.


sagarsharma
Kilo Guru

Hi Stephen,



As you correctly mentioned some g_form functions (like g_form.getReference()) are not supported by Mobile UI/Service Portal in servicenow. Please make sure you are using callback functions in such scripts to make them work.


You may find this link very useful http://wiki.servicenow.com/index.php?title=Mobile_Client_GlideForm_(g_form)_Scripting#gsc.tab=0


http://wiki.servicenow.com/index.php?title=Mobile_Client_GlideForm_(g_form)_Scripting#gsc.tab=0



Please Like, mark helpful depending on the impact of response.