How get deleted row in child table

I trying to do some logic when delete som row for child table
I tried :

before_table_remove
table_remove

But both of them give me same effect when:

console.log(frm.doc.table) ;

It is return table’s rows after deleting
What I want is getting deleted rows
How I can get that?

Try the following:

before_table_remove: function(frm, cdt, cdn) {
    var deleted_row = frappe.get_doc(cdt, cdn);
    console.log(deleted_row);
}
1 Like

@nabinhait It is not working, It is return undefined

Where are you writing this function? It should be like this for deletion of Item row in SO.

frappe.ui.form.on("Sales Order Item", {
	before_items_remove: function(frm, cdt, cdn) {
		var deleted_row = frappe.get_doc(cdt, cdn);
		console.log(deleted_row);
	}
})

@nabinhait I do as you said:


but it is not working!

Yes, I am also just tested, it is not working as expected. I think there is an error, I will investigate and fix that.

@nabinhait Could you give me some hint to fix this to?

I also don’t have any idea about it, have to dig into the code and find out.

@Mohammed_Redha @nabinhait

Old post but I was looking similar scenario, so in V10 frappe version the solution from @nabinhait is VALID.

before_table_remove: function(frm, cdt, cdn) {
    var deleted_row = frappe.get_doc(cdt, cdn);
    console.log(deleted_row);
}
1 Like

@kickapoo Thanks for your notes :grinning: