Assign to action is reflected as a new entry in ToDo doctype, so you can make your events there like after insert to catch the assigned to
I managed to make a button opens the assign to dialog.
I want to set valued automaticlly based on the field of the form.
I used this code:
btn: function (frm) {
cur_frm.assign_to.add();
cur_frm.assign_to.dialog.set_values({ assign_to: frm.doc.usr });
cur_frm.assign_to.dialog.set_values({ description: "Urgent" });
frm.assign_to.dialog.primary_action();
}
However, set_value didn’t work!
I had same issue , I tried below code and it worked for me.
frm.assign_to.add()
frm.assign_to.assign_to.dialog.fields_dict.assign_to.set_value(["test@gmail.com","test2@gmail.com"])
setTimeout(function() {
frm.assign_to.assign_to.dialog.refresh();
frm.assign_to.assign_to.dialog.primary_action();
},2);
1 Like