I want to create a Custom Action in Link Field following Custom Action in Link Field this documentation. But where exactly write this code, I don’t understand. I already have this many ways in the doctype js file.
Like:
frappe.ui.form.ControlLink.link_options('test 2', {
return [
{
html: "<span class="text-primary link-option">"
+ "<i class="fa fa-search" style="margin-right: 5px;"></i> "
+ __("Custom Link Option")
+ "</span>",
label: __("Custom Link Option"),
value: "custom__link_option",
action: () => {}
}
];
});
One more:
frappe.ui.form.ControlLink.link_options = function(link) {
return [
{
html: "<span class="text-primary link-option">"
+ "<i class="fa fa-search" style="margin-right: 5px;"></i> "
+ __("Custom Link Option")
+ "</span>",
label: __("Custom Link Option"),
value: "custom__link_option",
action: () => {}
}
];
}
And many more ways I already try this. But I am not able to understand this coding process.
If any one know this process. Please help me.
Thanks