GlideModal are not working onSubmit(script on employee service center core scope) on service portal

vajgsgc
Tera Contributor

Hi All,

I have written one Catalog client script for one our record producer and in that i have used GlideModal its not working.

Please guide me here what i need to use to call the OOTB UI("glide_confirm_basic") page from OnSubmit() catalog client script for basic pop up on ESC portal.

Catalog  client script:

Type: OnSubmit

Application: Employee Service Center

UI Type: All

 

code:

var text = "If you want to raise a new case by using the same form, please <a href='esc?id=sc_cat_item&table=sc_cat_item&sys_id=c03d15f01bcc5a102b80ea82b24bcb58' target='_blank' > Click Here </a>";
var gm = new GlideModal("glide_confirm_basic", true, 600);
    gm.setTitle("Test title");
    gm.setPreference("title", text);
    gm.setPreference("onPromptComplete", function() {
            alert("Ok");
        });
    gm.setPreference("onPromptCancel", function() {
            alert("Cancel");
        });
    gm.render();
 
After submitting the Record producer form getting the javascript error
vajgsgc_0-1730226902223.png

 

1 REPLY 1

Kieran Anson
Kilo Patron

You'd need to have two client scripts, one for the backend where GlideModal is available, and then spModal is the API available in the service portal.

https://www.servicenow.com/community/developer-articles/cce5048-enhance-your-catalog-items-with-cont...