- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2017 01:20 AM
We have to get sys id of catlog item (current).
As per below code we have used getParameter() function, which is running fine on service now view, but not running for Service portal.
Any one knows alternative to get current sys id of catalog item in script include ?
Script include
var ApplicationModule = Class.create();
ApplicationModule.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getCatItemAppMod: function () {
var cat_sys_id = this.getParameter('sysparm_cat_sys_id');
var gr = new GlideRecord('sc_cat_item');
//gr.addQuery('sys_id','b69a135f13967e00be19bda12244b0e7');
gr.addQuery('sys_id',cat_sys_id);
gr.query();
if (gr.next()) {
return "u_application=" + gr.u_application_name + "^u_module=" + gr.u_default_module;
}
return 'Yes to check';
},
Solved! Go to Solution.
- Labels:
-
Service Portal Development