The customized Ui action is not working in workspace

msc
Tera Contributor

Hi All, 

 

i have a requirement to add the custom ui actions in configurable workspace case form.

but it is not working actually.

below is the code :

function displayPopUp() {
    var gm = new GlideModal('comm_plan_select');
    //Sets the dialog title
    gm.setTitle('Send Initial Engagement for ' + g_form.getValue('number'));
    //returns the value of the title
    var title = gm.getPreference('title');
    gm.setPreference('param_sys_id', g_form.getUniqueValue());
    gm.setPreference('param_table', g_form.getTableName());
    gm.setPreference('param_type', 'Initial Engagement');
    gm.setWidth(550);
    //Opens the dialog
    gm.render();
}
 
msc_0-1721042160714.png

 


i have used the same code in workspace client script also but not working.

 

 

  • @
3 REPLIES 3

Community Alums
Not applicable

The getPreference('title') method does not return the title of the dialog
Removed var title = gm.getPreference('title'); This line was unnecessary as getPreference('title') does not retrieve the modal’s title. The title is set directly with gm.setTitle()

 

function displayPopUp() {
var gm = new GlideModal('comm_plan_select');
// Sets the dialog title
gm.setTitle('Send Initial Engagement for ' + g_form.getValue ('number'));
// Sets preferences for the modal
gm.setPreference('param_sys_id', g_form.getUniqueValue());
gm.setPreference('param_table', g_form.getTableName());
gm.setPreference('param_type', 'Initial Engagement');
gm.setWidth(550);
// Opens the dialog
gm.render();
}

Dibyaratnam
Tera Sage

Workspace client script doesnt support glidemodal. Follow the below article which might help you.

https://www.servicenow.com/community/next-experience-articles/how-to-use-ui-actions-in-workspaces/ta...

msc
Tera Contributor

Hi  Sam, i have tried the g_modal.showframe, the popu upis appearing but form is not submitting and parameters are not passed.

function displayPop(g_form) {
    var ui_page_id = 'c0756c461b3961104b610d076e4bcb90'; // Replace with your UI Page sys_id or name

    g_modal.showFrame({
        url: '/ui_page.do?sys_id=' + ui_page_id,
        title: 'Engage engineering for ' + g_form.getValue('number'),
        size: 'lg',
        height: 500,
        dialogClass: 'csm-modal',
        params: {
            sys_id: g_form.getUniqueValue(),
            table: g_form.getTableName(),
            type: 'Engineering'
        }
    });
// onClick function (assuming it receives g_form automatically)
function onClick(g_form) {
    displayPop(g_form);
}
could you please helpme out how topass parameters to fetch the backend data
  var gm = new GlideModal('comm_plan_select_eng');
    //Sets the dialog title
    gm.setTitle('Engage engineering for ' + g_form.getValue('number'));
    //returns the value of the title
    var title = gm.getPreference('title');
    gm.setPreference('param_sys_id', g_form.getUniqueValue());
    gm.setPreference('param_table', g_form.getTableName());
    gm.setPreference('param_type', 'Engineering');
    gm.setWidth(550);
    //Opens the dialog
    gm.render();