Hi everyone, as per the title above, does anyone know how to filter the DocType choices for Dynamic Link in a Child Table?
Below is a screenshot of the child table in Employee Doctype
I wanted to filter the ‘Lifecycle’ field in the table to only: ‘Job Applicant’, ‘Job Offer’, ‘Employee Transfer’, ‘Employee Promotion’, ‘Employee Separation’
.
Below is my attempted custom script which didn’t work
frappe.ui.form.on('Employee Lifecycle', {
setup: function(frm, cdt, cdn) {
frm.set_query('lifecycle', function() {
return {
'filters': {
'name': ['in', ['Job Applicant', 'Job Offer', 'Employee Transfer', 'Employee Promotion', 'Employee Separation']],
}
};
});
}
});
This didn’t work either
frappe.ui.form.on('Employee', 'employee_lifecycle', function(frm, cdt, cdn) {
frm.set_query('lifecycle', function(frm, cdt, cdn) {
return {
'filters': {
ID: 'Job Applicant' || 'Job Offer' || 'Employee Transfer' || 'Employee Promotion' || 'Employee Separation'
}
}
})
})
I use this script on Item’s refresh event.
frappe.ui.form.on("Item", {
refresh: (frm) => {
frm.fields_dict['ld_urunagaci'].grid.get_field('ld_parca_tipi').get_query = function(doc, cdt, cdn) {
return {
filters:[
['parent_item_group', '=', 'Alt Parça']
]
}
};.........
1 Like
lokesh
December 19, 2019, 10:10am
4
I hope this link will help you.
Hi,
I want to filter data on child table,
I’ve Child Table named ‘BS Tracking Reviews’
BS Tracking Reviews have field ‘balance_sheet’ which is linked to Doctype named ‘Heads’
in Heads i’ve field named ‘client’ and i also have ‘client’ field in Parent doctype named “Tracking Reviews”.
I want to filter Heads Data in Tracking Forms, according to clients.
Find below images for reference.
[1]
[Screenshot%20from%202018-10-15%2019-12-21]
I’ve tried below script but it is not working.
frappe.u…