I want to copy incident short description value from current incident to catalog item view of a specific item like "Standard Laptop"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 06:56 AM
Hello All,
I want to copy incident short description text from current incident to "catalog item view" of a specific item like "Standard Laptop"?
for example I have entered text in short description field in my current incident form as below and I need to copy same text into Description variable of "Standard Laptop" catalog item, Please find the screen shots below incident form short description and "Standard Laptop" catalog item view
NOTE : I have a "Create Request" UI Action on incident form when I have been clicked on it, it will move to "Standard Laptop" catalog item view but not coping incident short description into "Standard Laptop" item description variable
UI Action code below :
Incident Short Description
Standard Laptop catalog item view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 07:12 AM
Hi Shantharao,
You need to send the value from url example below highlighted in bold
Also you should not hard code the instance name, you can directly give the url of the try it page
var description = current.short_description;
var url = '/com.glideapp.servicecatalog_cat_item_view.do?v=1&sysparm_id=1fe8259c4fba5740fc11fa218110c796&sysparm_description=' + description;
action.setRedirectURL(url);
write an onLoad client script and fetch the parameter value and use setValue
function onLoad(){
}
function getParmVal(name){
var url = document.URL.parseQuery();
if(url[name]){
return decodeURI(url[name]);
}
else{
return;
}
}
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2018 09:27 AM
Hello Ankur,
Thanks for the reply it is working fine in backend view but it is not populating in service portal,
Any solution is appropriated, I have written onLoad client script UI type = All even though it is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 07:29 AM
This link has given me an answer, it working great by using putClientData and getClientData methods
https://community.servicenow.com/community?id=community_question&sys_id=9dbf366ddb58dbc01dcaf3231f9619a0