How to create a alert message on List View ?

shabbir5
Tera Guru

Hi,

I want to show a alert message when i click  a button on choice list.

Any suggestions?

Thank You,

Shabbir

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You can use List Choice or List Banner button and make this as client side UI Action

Client - True

Onclick - showAlert();

Script:

function showAlert(){

alert('Your Message Here');

}

Regards
Ankur

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

Hi Ankur,

Thank you for the quick response , here i want the alert for "approve" ui action on sysapproval_approve table , that is a OOB ui action and client callable checknox is not true for that,

i tried by making client callable as true and put alert message , but the functioality is not working.

Any other alternatives to do this?

Thank you,

Shabbir

Hi,

which UI action?

List choice or List Context Menu?

Regards
Ankur

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

@shabbir 

you can convert that UI action as Client + Server

Client - true

Onclick - showMessage();

Script:

function showMessage(){
	alert('Do you want to approve');
	gsftSubmit(null, g_form.getFormElement(), 'approve_custom');
}

if(typeof window == 'undefined')
	serverCode();


function serverCode(){

	current.state="approved";
	current.update();
	new ApprovalUserFeedback().approved(current);

}

Changes like this

find_real_file.png

Regards
Ankur

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