Error in set_value

using the following script i want to set value in lead .{
“method”: “frappe.client.set_value”,
“args”: {
“doctype”: “Lead”,
“fieldname”: “name”,
“fieldname”: “lead_owner”,
“value”: email
async: false
but i am getting error message :

Probably your issues lies somewhere here.


Is email a local JS variable or a string ?

Hi, @root13F
var email = $(“[data-fieldname=‘email’]”).val();
“value”:email (it is a local variable.)

Thank You

i am not sure but try this:{
"method": "frappe.client.set_value",
"args": {
"doctype": "Lead",
"fieldname": "lead_owner",
async: false

Hi @Maheshwari_Bhavesh
what i am exactly doing…

  1. create a button in User Dashboard.
  2. on that button opening a dialog box.
  3. from this dialog box user can select email_id & this email_id should be set in lead_owner field in lead doctype.


Thank You

i am trying your script but still giving error.
TypeError: set_value() takes at least 3 arguments (3 given)

Thank You

necessary to pass lead name in arguments but in user setting lead number not available. you should add one more field in pop up for select lead number and pass that number in argument

let’s see if user can assign bulk lead then in this case my scenario will be failure.

I found the Solution.
Thank You so much for your help

share solution


		method: 'frappe.desk.doctype.bulk_update.bulk_update.update',
		args: {
			doctype: 'Lead',
			field: 'lead_owner',
		    value: email,
			condition: "lead_owner='"+actual_owner+"'",
            limit: 100

mark this as solution instead.