Email Sent Twice

Hello Everyone,

I wrote a small code to fetch the data from one field name “username” to the field name “email” in the user doctype.

frappe.ui.form.on('User', {
    	    var a = frm.doc.username;


Emails are sent twice at the same.

I had even tried refresh, onload and before save events but emails are sent twice. Any solution for this?

Hi @srushti,

Remove your script and after then check message is shown twice or not.
And which version do you use?

Thank You!

If I remove the code it sends only one email or if I type manually still it sends it once but if I write the code then the email is sent twice. I m writing code because i m fetching data from another doctype. I M using version frappe:14.6 and ERpnext version: 14.1

Hi @srushti,

Please try it.

frappe.ui.form.on('User',  {
    username: function(frm) {
        frm.set_value("email", frm.doc.username);

When you enter the username the automatically set email as a username.
If you are comfortable with it then apply and reload and check it.

Thank You!