Using UI page for workspace client script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 11:01 AM
I am trying to use OOTB Closed Complete UI action in CSM configurable workspace. The UI action script is calling a UI page:
------------------------UI ACTION OOTB SCRIPT-----------------------------------------
function openFollowOnPopUp(){
var dialogClass;
try {
dialogClass = GlideModal;
} catch(e) {
dialogClass = GlideDialogWindow;
}
var dialog = new dialogClass("service_management_task_closed_incomplete");
dialog.setWidth("550");
dialog.setTitle("Close Incomplete");
dialog.setPreference("sys_id", g_form.getUniqueValue());
dialog.setPreference("work_notes", g_form.getValue("work_notes"));
dialog.setPreference("state_flow_id", "41dfa2e0d7630100fceaa6859e61035d");
dialog.render(); //Open the dialog
}
--------------------------------------------------------------------------------------------------------------
I can call the UI page but not sure how to set preferences in Workspace client script for sysID, work notes and state flow id. My workspace client script looks like this ( the red part is not working):
function onClick(g_form) {
var ui_page_id = '03d9bd5fdf81300068c383f36bf26312';
g_modal.showFrame({
url: '/ui_page.do?sys_id=' + ui_page_id,
title: 'Close Incomplete',
fields: fields,
})
.then(function(fieldValues) {
g_form.setValue('sys_id', g_form.getUniqueValue());
g_form.setValue('work_notes', g_form.getValue("work_notes"));
g_form.setValue('state_flow_id', '41dfa2e0d7630100fceaa6859e61035d');
g_form.save();
},
function(error) {
location.reload(); //to refresh the page if "cancel" or "X" is clicked
});
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 03:46 AM
Are you able to solve the isssue?