g_model callback function is not returning the results

Venkatesh4
Tera Expert

Hi Everyone,

 

I am seeking help with a challenge I'm facing while trying to make a custom UI action available on Workspace. I attempted to use g_modal for displaying the UI page.

 

The issue arises with the callback function—it consistently returns false, making it impossible to determine which option the user selected (Cancel or Submit). Knowing the selected option is crucial for triggering an info message and displaying it to the user in the Workspace view. Since I’m unable to read the response, I’m unable to proceed further.

 

Here’s the code snippet I’m currently using:

 

 

function onClick(g_form) {

    g_modal.showFrame({

        url: 'ABCD.do?' + 'sysparm_id=' + g_form.getUniqueValue() + '&sysparm_num=' + g_form.getValue('number') + "&sysparm_workspace=" + true,

        title: 'Engage With ABCD',

        //size: 'fw'

        height: 500,

        width: 1000,

//callback: callingfunction ->Not working

        }).then(function(response) { -> Not working

        alert(response); -> Always return false.

    });

//function callingfunction(){

//g_form.addInfoMessage('Notification triggered to ABCD');

//}

 

}

 

I want to basically show info message if a user click on submit in the ui page and once the UI page is closed I need the info message to be displayed to user.

 

Please assist 

Thanks in advance

3 REPLIES 3

Bert_c1
Kilo Patron

See:

 

GlideModalV3 API

 

there is no 'g_modal' class/API that I'm aware of.

rrataj
Kilo Expert

in Workspace I am using the same code just with g_modal.showFields
so the  I guess the g_modal.showFrame has some issues and is not returning the response

- is the URL correct? are you able to execute the constructed URL? perhaps try with a full URL ? 

- are there some ACL that might block the URL execution from client side ?  

Saranya Babu1
Tera Expert

Are you able to fix this? I am also facing similar issue