Display field based on selection in another field

i created custom field in sales order item called select item group i need when select the group from this field another field display for sup item group form this group selected and so on till find the item it self

Hi @Alaa_Badri! I believe you are looking at field filters based from a selection on another select field. See same usecase here.

you can use toggle_display

cur_frm.toggle_display('fieldname', condition to display field);

or use Depends on for fields to display on condition

e.g. eval:doc.select_item_group that mean field get displayed only if select_item_group field is filled

1 Like

Hello Sangram,

In my case i select item in purchase reciept i want to auto populate that item into the batch.how this is possible .please help.

Hi you can write this on .js file. Onchange of item_code

frappe.ui.form.on(“Purchase Receipt Item”, {
item_code: function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
frappe.model.set_value(cdt, cdn, “batch”,row.item_code);


You can use set_query function using custom js.