- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 05:32 AM - edited 11-10-2023 05:33 AM
Hello,
I would like to receive some help. I have tried to solve this functionality request, but haven't succeeded, so therefore I am reaching out to this amazing community.
I would like to change our current UI action, which creates a change request from a RITM and transfers some of the RITM fields into the Change fields. The change should now include that it also opens the new change in a new window. Currently the ritm window is being refreshed, as per SN default. However, my colleagues would like to keep having the RITM open while opening the change request.
So how can I add that functionality of opening the change in a new window tab?
I have tried to include it in the script as per other community post solutions and check the client script, but haven't suceeded yet. Errors keep popping up when trying to include both server and client side script in the same ui action.
Let me know if further info is needed.
Thanks!
Solved! Go to Solution.
- Labels:
-
Change Management
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 03:46 PM
Hi @Lkr, In UI actions you can pass value from client to server & not the other way around. To open a URL in new window you can use below code(you might have to tweak as per your requirement though):
1. Create a Client callable script include
var ChangePopupTest = Class.create();
ChangePopupTest.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getNewWindow: function() {
var parentID = this.getParameter('sysparm_url');
//below code is from the OOTB Create Change UI action
var url = new GlideURL("change_request.do");
url.set("sys_id", "-1");
url.set("sysparm_query", "^parent=" + parentID);
var finalStr = url.toString();
return finalStr;
},
type: 'ChangePopupTest'
});
2. In the original Create Change UI action, select 'Client' checkbox, add call below function in the onClick field & add below code in the script.
function fetchURL() {
var ga = new GlideAjax('ChangePopupTest');
ga.addParam('sysparm_name', 'getNewWindow');
ga.addParam('sysparm_url', g_form.getUniqueValue());
ga.getXML(showPopup);
function showPopup(response) {
var newURL = response.responseXML.documentElement.getAttribute("answer");
g_navigation.openPopup(newURL);
}
}
Please mark helpful and correct if it resolved your issue.
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 08:18 PM
@Lkr did it resolve the issue? if yes, please accept it as solution
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 12:33 AM - edited 01-05-2024 12:33 AM
@JohnnySnow Thank you, yes it works!
Would it be in my script include I can add to your script if I would like it to populate description, short description and other fields from the parent REQItem to the new change? Right now the parent is set, which is very good, but I would like further information to get copied as well.
@Reddy See solution above from JohnnySnow.