how to add Info Message to List Action Assignment in Workspace

Alon Grod
Tera Expert

Hi,

This is my List Action Assignment, the functionality is working find but im trying add g_from.addInfoMessage('hi') but nothing is happening.
How can I add info message so it will be visible to the user in List view.

AlonGrod_0-1767264772403.png

function onClick() {

    var checkedRecords = g_list.getChecked();
	//gs.addInfoMessage('hi');
	//g_form.addInfoMessage('tttt');
    var ga = new GlideAjax('WmTaskBatchPdfExporter');
    ga.addParam('sysparm_name', 'isPdf'); // Setting input
    ga.addParam('sysparm_sys', checkedRecords);

    ga.getXML(ajaxCallback);
}

function ajaxCallback(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer) {
		
		top.location.href = answer;
       
    }
}

 

13 REPLIES 13

@Alon Grod 

yes g_modal should work

something like this

g_modal - Client 

How to use UI Actions in Workspaces 

function onClick() {

    var checkedRecords = g_list.getChecked();
    //gs.addInfoMessage('hi');
    //g_form.addInfoMessage('tttt');
    var ga = new GlideAjax('WmTaskBatchPdfExporter');
    ga.addParam('sysparm_name', 'isPdf'); // Setting input
    ga.addParam('sysparm_sys', checkedRecords);

    ga.getXML(ajaxCallback);
}

function ajaxCallback(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    if (answer) {
        g_modal.alert('Response from server' + answer);
        top.location.href = answer;

    }
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Alon Grod 

this worked for me

AnkurBawiskar_0-1767510842886.png

Output

AnkurBawiskar_1-1767510863132.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello @Alon Grod ,

Yes , Glide modal will works . Just add   'g_modal.laert(msg)' where you have to add show the msg;

 

adityahubli_0-1767528995797.pngScreenshot (1163).png

 

If this helps you then mark it as helpful and accept as solution.

Regards,

Aditya,

Technical consultant

 

Ankur Bawiskar
Tera Patron

@Alon Grod 

see if this helps

Why addInfoMessage / addErrorMessage Don't Work in Custom Workspaces – and How to Fix It 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader