In short,
How to pre populate some fields when you click on the link option which is “create a new document”??
See this image and i want that how I can target the option in the link field which is create a new document ( here document is basically depends on the Doctype).
I want that when I click on this option, some of fields must be pre populated in that document.
I know one thing which is frappe.new_doc and we can write in this in the object form.
But how can I run that function when I click on that option.
How i can target that option in that link field which can help me to pre populate the fields in that document.
You have to create a button and then apply the logic, i think, directly not possible, that for you have to check the core functionality of “Create a new”.
As per latest stable Frappe v15.45.0 this works as expected: It opens the forms for creating new docs of Land and Animal and then also pre-fills the fields ‘farmer_id’ and ‘producer’ in those respective forms from the “Producer” doctype.