How to hide the create a new User option in child table

How to hide the create a new user option in child table.i only need to select this field

Screenshot from 2024-04-15 16-39-11

Hy @neha
Please read this post

Thank You!

its not working for child table field

Sometimes, does not always apply the parent logic in child table, some has a limitation. if you want then apply it but it will only work when you select the add row button, it does not work on the first row if the first row has already added.

Please check the syntax:

frappe.ui.form.on('Child Table DocType', {
	childtablename_add: function(frm, cdt, cdn) {
	    var child = locals[cdt][cdn];
	    frm.set_df_property('child_table_name', 'only_select', true, frm.docname, 'your_link_field_name', child.name);
	    frm.refresh_field('child_table_name');
	}
});

// Example:
frappe.ui.form.on('Sales Invoice Item', {
	items_add: function(frm, cdt, cdn) {
	    var child = locals[cdt][cdn];
	    frm.set_df_property('items', 'only_select', true, frm.docname, 'item_code', child.name);
	    frm.refresh_field('items');
	}
});
1 Like