- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 07:38 AM
Hi,
When I "Submit" a Service catalog item on service Portal, the request page (sc_request) opens.
I would like a rediction of this submit to ritm page instead sc_request page.
I know I have to modifiy the clone of the widget "SC Catalog Item" but I don't know how.
Any idea ?
Thanks for your help,
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2019 08:55 AM
Hi there,
I am not sure it is relevant for you anymore, but still, in case someone else needs it, this is what worked for me:
1. Clone the SC Catalog Item widget
2. change the client script:
(look for "$location.search('id=sc_request&is_new_order..." around line 510)
//$location.search('id=sc_request&is_new_order=true&table=sc_request&sys_id=' + a.sys_id); //--> we do not want to redirect to the sc_request page
c.data.myrequest = a.sys_id;
c.server.update();
setTimeout(function(){
var ritmid = c.data.ritmId;
$location.search('id=form&table=sc_req_item&view=ess&sys_id=' + ritmid);
}, 400);
}
3. and in the server script, arounbd line 11, right after return;, add
if(input) {
if(input.myrequest != undefined) {
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request',input.myrequest); //from line 514 in the client script ritm.query();
//If exactly one RITM is returned, pass to the Client Controller to redirect user
if(ritm.next()) {
data.ritmId = ritm.getUniqueValue();
}
}
That's it.
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 07:46 AM
I think you just need to change this line in the Server portion:
options.url = options.url || "?id=my_history";
This is mine (ie already modified). Replace the "?id=my_history" with the link you'd rather have it use instead.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2019 07:53 AM
Try the solution describe in the below link
https://community.servicenow.com/community?id=community_question&sys_id=daaf216adb976300b1b102d5ca9619db
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2019 08:55 AM
Hi there,
I am not sure it is relevant for you anymore, but still, in case someone else needs it, this is what worked for me:
1. Clone the SC Catalog Item widget
2. change the client script:
(look for "$location.search('id=sc_request&is_new_order..." around line 510)
//$location.search('id=sc_request&is_new_order=true&table=sc_request&sys_id=' + a.sys_id); //--> we do not want to redirect to the sc_request page
c.data.myrequest = a.sys_id;
c.server.update();
setTimeout(function(){
var ritmid = c.data.ritmId;
$location.search('id=form&table=sc_req_item&view=ess&sys_id=' + ritmid);
}, 400);
}
3. and in the server script, arounbd line 11, right after return;, add
if(input) {
if(input.myrequest != undefined) {
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request',input.myrequest); //from line 514 in the client script ritm.query();
//If exactly one RITM is returned, pass to the Client Controller to redirect user
if(ritm.next()) {
data.ritmId = ritm.getUniqueValue();
}
}
That's it.
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2020 07:24 AM
Hi Harel,
Can you please help me how to user this Widget after that?
Regards,
Monika