UI Page in Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 11:20 PM
Hello @Ankur Bawiskar ,
have created seperated thread and below is the need , we have UI Action called session and when it's clicked it open page and display Session link and Key , Currently we have following script in UI Action which works perfect in Native UI but fails when we use this in SOW workspace reason being GlideModal is not allowed in Workspace
function onClick(g_form) {
generateERSServerSessionKey();
function generateERSServerSessionKey() {
var ga = new GlideAjax('x_bmgr_support_ent.BomgarRemoteSupport');
ga.addParam('sysparm_name', 'generateSessionKeyServerSide');
ga.addParam('sysparm_record_id', g_form.getUniqueValue());
ga.addParam('sysparm_table_type', 'task');
ga.getXML(handleERSServerSessionKeyCallback);
}
function handleERSServerSessionKeyCallback(response) {
var answerString = response.responseXML.documentElement.getAttribute("answer");
if (answerString === null) {
alert('Something went wrong while attempting to generate a session key.');
return;
} else if (answerString.startsWith('ERROR')) {
var error = answerString.substring(6);
alert('An error occurred: ' + error);
return;
}
var sessionKeyJson = JSON.parse(answerString);
openLanguagePopup(sessionKeyJson);
}
function openLanguagePopup(sessionKeyJson) {
var dialog = new GlideModal('bomgar_session_key');
dialog.setTitle("Remote Support Session Key");
dialog.setSize(620, 200);
dialog.setPreference("session_link", sessionKeyJson.keyUrl);
dialog.setPreference("session_key", sessionKeyJson.shortKey);
dialog.setPreference("record_id", g_form.getUniqueValue());
dialog.setPreference("subject", sessionKeyJson.mailSubject);
dialog.setPreference("body", sessionKeyJson.mailBody);
dialog.render();
}
}
========
This Following Script perfectly Open/pops the page but the values are'nt parsed , can you please do how we can parse the values into the UI Page
function onClick(g_form) {
var ui_page_id = '15090aad4f8c4200237ca5017310c703';
g_modal.showFrame({
url: '/ui_page.do?sys_id=' + ui_page_id,
title: 'Session Key',
size: 'xl',
height: 500
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 11:29 PM
you are just calling the UI page but not sending any values to it when called from workspace
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 11:33 PM
@Ankur Bawiskar , I dont have idea how to parse the json into this ui page logic , i was looking for help on that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2024 12:58 AM
@Ankur Bawiskar Any reference how we can parse JSON workspace client scripts?