Task Assign To Custome script

IN Task page

there is assigned to click on the left hand of the page
by click it then we can assign that task to specific user .

  1. i need to add a custom field in the task page and lets called it

Assigned To as a read only type

  1. i want when i click on the left assigned to so

it will effect on the costume field and type the name of the one who assigned to .

Thx a lot for your help .

Thx alot for your help

  1. i successfully added Assigned To Read only field
  2. i dont understand how to do the second step

Hi @sheno,

You can achieve the 2nd step by using the hooks, add the after_insert hook for ToDo doctype.

then in your hook method add the code to set the value to Assigned To field in task.

Please refer the following code

if self.reference_type == "Task" and self.reference_name:
	frappe.db.set_value("Task", self.reference_name, "assigned_to", self.owner)

Thanks, Makarand

1 Like

thx a lot for replay

actually i dont know hook

where is it located to add this command in it

@sheno,

Please refer the developer manual for hooks documentations.

Thanks, Makarand

1 Like