How do I stop a link field from autoclearing?

Hi @zeeeeeeeero:

Ok, I understand now… I see 2 possible ways

  1. Override frappe.client.validate_link . This method check if data provided exists on the linked doctype. If doesn’t then data is cleared.

  2. Change your field type to autocomplete, and manually manage linking data. Basically, autocomplete is like a link field without standard link field behavior :upside_down_face: 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 :wink:
Hope this helps.