How to show pop up message to a specific user?

How to show pop up message to a specific user using js or python?

var my_message = This is a warning message!
alert (my_message);

You can use frappe.msgprint function too for the purpose.


i want to show pop message to a specific user only for an event.for example if i press save button in a doctype the pop up message should show only for the given user (message will be like user ‘user_name’ saved a ‘doctype_name’)


if(user=="user_login_id") {
    frappe.msgprint("{0} save the doctype {1}", [user, doctype_name]);


if frappe.session.user == "user_login_id":
    frappe.msgprint("{0} save the doctype {1}".format(frappe.session.user, doctype_name))

it is working only if specified user save a doctype.
i need like this.

there are two users in erpnext

1.user a
2.user b

both user a and b are logged in to erpnext.

if user a save a document type.pop up message should show for user b only.

i tried frappe.publish_realtime() but it is not working

for frappe.publish_realtime() to work socketio must be running.

how to run socketio in production mode

It automatically starts in production setup.

Check if it’s running

sudo supervisorctl status all

To setup socketio

bench setup socketio

I am in production order

socket io working fine

frappe.publish_realtime() is not working.please check the attached picture

but pop up can not see for user tried for all user but it is not working



Specify event, message and user parameter, refer


Working now.Thank you