Hi @zeeeeeeeero:
Ok, I understand now… I see 2 possible ways
-
Override
frappe.client.validate_link. This method check if data provided exists on the linked doctype. If doesn’t then data is cleared. -
Change your field type to autocomplete, and manually manage linking data. Basically, autocomplete is like a link field without standard link field behavior
With client script, you can dynamically set data to the field and, in case of new batch, create new one.
Check this:
Maybe there is an easier way to achieve this … but … it’s still monday morning ![]()
Hope this helps.