- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 12:39 AM
Hi
I have a requirement to open RITM on portal if i client on Open In Portal button.
Please help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 10:36 PM - edited 11-07-2024 10:38 PM
Hi @RunsumS ,
You can create UI action "sc_req_item" table like below.
Code:
function openPortal() {
var ga = new GlideAjax('getBaseURL');
ga.addParam('sysparm_name', 'BaseURL');
ga.getXML(ServiceNowBaseURL);
function ServiceNowBaseURL(response) {
var baseUrl = response.responseXML.documentElement.getAttribute("answer");
}
var url = baseUrl + 'sp?id=ticket&table=sc_req_item&sys_id=' + g_form.getUniqueValue();
g_navigation.open(url, '_blank');
}
In Script include write code like below
var getBaseURL= Class.create();
UserUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
BaseURL: function() {
return gs.getProperty('glide.servlet.uri');
},
type: 'getBaseURL'
});
Refer GlideAjax in details here: https://servicenowwithrunjay.com/glideajax-in-servicenow/
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 06:06 AM
Where this button your adding?
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 06:32 AM
@RunsumS You can try UI action with below script.
var ritmSysId = current.sys_id;
var portalUrl = '/sp?id=sc_request_item&sys_id=' + ritmSysId;
action.setRedirectURL(portalUrl);
Please mark my answer correct and helpful if this works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 11:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 10:36 PM - edited 11-07-2024 10:38 PM
Hi @RunsumS ,
You can create UI action "sc_req_item" table like below.
Code:
function openPortal() {
var ga = new GlideAjax('getBaseURL');
ga.addParam('sysparm_name', 'BaseURL');
ga.getXML(ServiceNowBaseURL);
function ServiceNowBaseURL(response) {
var baseUrl = response.responseXML.documentElement.getAttribute("answer");
}
var url = baseUrl + 'sp?id=ticket&table=sc_req_item&sys_id=' + g_form.getUniqueValue();
g_navigation.open(url, '_blank');
}
In Script include write code like below
var getBaseURL= Class.create();
UserUtils.prototype = Object.extendsObject(AbstractAjaxProcessor, {
BaseURL: function() {
return gs.getProperty('glide.servlet.uri');
},
type: 'getBaseURL'
});
Refer GlideAjax in details here: https://servicenowwithrunjay.com/glideajax-in-servicenow/
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------