I got it, by using the jquery . Its working fine now.
frappe.db.get_value(“User”,frappe.session.user,“company”, function(v){
var data = frm.doc.accounts;
data.forEach(function(e){
if (e.company != v.company){
$(“[data-idx='”+e.idx+“']”).hide()
}
})
});
Following on from this thread, how would I go about hiding a particular row when printing if the value of a field is equal to zero?
For example, in the Sales Order item table, if I have the field Rate set to 0.00 how could I hide the entire row for that item when it comes to printing?
The solution is fine if you only got 1 child table, because the selctor “data-idx=‘any number’” will match with any child table on your Form View. To restrict hiding to a single certain child table use this:
let datatable = $("[data-fieldname='veranstaltung_gaesteliste']");
for (let row of frm.doc.veranstaltung_gaesteliste) {
if (row.some_field == 'some_value') {
let child = $(datatable).find(`[data-idx='${row.idx}']`);
child.hide();
}
}
Where ‘veranstaltung_gaesteliste’ is the Field Name of the Table Field.