referenceError:g_service_catalog is not defined - Portal Error

Lavanya11
Kilo Sage

We have a custom Module in Service Portal, where we order items like hardware, software etc. Now in this Module, when the ordering Items are loaded, I am getting an error "There is an Javascript error in the browser Console"(see attacment).

find_real_file.png

This error is because of the following Catalog Client Script.find_real_file.png

I tried by unClicking the Isolate Script button, it didn't work. Also by changing the UI type to All, nothing is working. I saw many suggestions in the community for the same error. But nothing worked for me. Could someone pour suggestions on this?

1 ACCEPTED SOLUTION

Lavanya11
Kilo Sage

Hi,

In the Catalog Client Scripts, I made the following Changes and then it got worked.

function onLoad() {
    if(typeof g_service_catalog !== 'undefined'){
        if(g_service_catalog.isOrderGuide()) { //only works in SP
            g_form.setDisplay("details", false); //hide complete variable set on order guide
        }
    }
}

View solution in original post

3 REPLIES 3

Tudor
Tera Guru

Hi,

I came across this http://www.cloudminus89.com/2020/07/useful-catalog-client-scripting-for.html

and it might solve your issue.

Hope it helps!

 Tudor

Mohith Devatte
Tera Sage
Tera Sage

Hello ,

This happens when glide.sc.use_sc_form_v2 this particular property is set to false in your instance .

please go to sys_properties  table and search for this property and check if this property is true or false

if it is false please set it to true and then try in portal or Native view again.

Please mark this accept the solution  if this solves the issue

Lavanya11
Kilo Sage

Hi,

In the Catalog Client Scripts, I made the following Changes and then it got worked.

function onLoad() {
    if(typeof g_service_catalog !== 'undefined'){
        if(g_service_catalog.isOrderGuide()) { //only works in SP
            g_form.setDisplay("details", false); //hide complete variable set on order guide
        }
    }
}