Custom filed with filtered option

Hi ,

im wondering how i can make a Link filed with Option Account , but only show expense account

Thanks

Add this to custom script of your doctype. Replace #field_name with actual field name of your account link

cur_frm.set_query(“#field_name”, function () {
return{
filters: { ‘root_type’: ‘Expense’ }
}
});

1 Like

cant we just set it in custom filed Option field ?, or it must be from custom script ?

It has to be custom script.

Great Thanksss… :slight_smile: