Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

"Copy Universal Request " UI action is not working

pranita-24
Tera Guru

Hi Everyone ,

I am facing issue with UI action "Copy universal request". On Universal Request record if there is any emoji is present that time UI action is not working . and I want even there is emoji is present UI action for coping UR should work .

Is there any way to converting Emojis into other format ?
Below is the UI action script 

function _getDocument() {
var iFrame = top.window.document.getElementById('gsft_main');
if (iFrame) {
return ((iFrame.contentDocument) ? iFrame.contentDocument : iFrame.contentWindow.document);
} else {
return top.window.document;
}
}
 
function OnCopyUniversalRequestClick(){
var srcSysId = g_form.getUniqueValue();
var ga = new GlideAjax('UniversalRequestAJAXUtils');
ga.addParam('sysparm_name', 'getUniversalRequestQueryParams');
ga.addParam('sysparm_src_sysid', srcSysId);
ga.addParam('sysparm_ui_action', "copy_universal_request");
ga.setWantSessionMessages(true);
ga.getXMLAnswer(function(queryParam) {
if (queryParam) {
var ck;
if (typeof g_ck != 'undefined' && g_ck != "")
ck = g_ck;
 
var gotoUrl = [];
gotoUrl.push('srcSysID=' + srcSysId);
gotoUrl.push('newSysID=$sys_id');
gotoUrl.push('sysparm_returned_action=$action');
gotoUrl.push('sysparm_ui_action=copy_universal_request');
if (ck)
gotoUrl.push('sysparm_ck=' + ck);
 
gotoUrl = 'sn_uni_req_CopyUniversalRequestAttachments.do?' + gotoUrl.join('&');
 
var form = cel('form', _getDocument().body);
hide(form);
form.method = "POST";
form.action = g_form.getTableName() + ".do";
if (ck)
addParam(form, 'sysparm_ck', g_ck);
addParam(form, 'sys_id', '-1');
addParam(form, 'sysparm_query', queryParam);
addParam(form, 'sysparm_goto_url', gotoUrl);
form.submit();
} else {
g_form.addErrorMessage("Failed to copy Universal Request");
}
});
}
function addParam(form, name, val) {
var inp = cel('textarea', form);
inp.name = name;
inp.value = val;
}

Please help me out to achieve this requirement.

Thanks,
Pranita
1 REPLY 1

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @pranita-24 

 

Why you want to copy the Universal request? It is not a recommended approach and violation of basis use of Universal request. 

*************************************************************************************************************
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]

****************************************************************************************************************