frappe.call({
method: "frappe.client.get",
args: {
doctype: "Logi360 Employee And Branch",
filters: {
name: frappe.session.user
},
fields: ["branch"]
},
callback: function(r) {
if (r.message) {
// Assuming the branch field is a select field with options like 'Branch A', 'Branch B', etc.
var currentUserBranch = r.message.branch;
console.log(currentUserBranch)
var selectBranches = currentUserBranch.map(function(branch) {
return branch.select_branch;
});
// Filter the documents based on the branch_pickup field
frappe.call({
method: "frappe.client.get_list",
args: {
doctype: "Logi360 Vendor Order",
filters: {
pickup_branch: ['in', selectBranches]
},
limit_page_length:false,
},
callback: function(r) {
if (r.message) {
**//i want to populate the liist view with the filtered rows**
}
}
});
}
}
});
this is my code
now how to add those rows in list of doctype?