
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 05:21 AM
Hi All,
Requirement is, there is "Copy Change" UI action button created to copy the change. Functionality is working as expected but the concern is...while copying, change should open in the same tab, not in new tab.
Below are the line of code written.
How we could open copied /new change in the same tab? please help me.
Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 05:40 AM
Hello @Virendra K
Give a try with this:
function OnCopyChangeClick() {
var srcSysId = g_form.getUniqueValue();
var ga = new GlideAjax('CustChangeDetails');
ga.addParam('sysparm_name', 'getChgDetails');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.getXMLAnswer(function(answer) {
var url = "/change_request.do?sys_id=" + answer;
window.location.href = url;
});
}
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 05:40 AM
Hello @Virendra K
Give a try with this:
function OnCopyChangeClick() {
var srcSysId = g_form.getUniqueValue();
var ga = new GlideAjax('CustChangeDetails');
ga.addParam('sysparm_name', 'getChgDetails');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.getXMLAnswer(function(answer) {
var url = "/change_request.do?sys_id=" + answer;
window.location.href = url;
});
}
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 06:00 AM
Thank you @Viraj Hudlikar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 05:43 AM
Hi Virendra,
Can you try this : window.location.href = url;