Custom Action in Link Field
You can add a new custom link option to the standard link field by defining the function in the namespace frappe.ui.form.ControlLink.link\_options
.
In the frappe.ui.form.ControlLink.link\_options
, you have access to the link field object.
1. Adding Custom Option
frappe.ui.form.ControlLink.link\_options = function(link) {
return [
{
html: ""
+ " "
+ \_\_("Custom Link Option")
+ "",
label: \_\_("Custom Link Option"),
value: "custom\_\_link\_option",
action: () => {}
}
];
}
Once a function is assigned to frappe.ui.form.ControlLink.link\_options
, the link field will have a new link option: