Try ERPNext Buy Support Partners Foundation

Get_value on child table failing with permission error

I noticed in the recent updates some changes to get_value were made to prevent abuse of child table values through the api (https://github.com/frappe/frappe/pull/5311/commits/595929eb2432140a27dc262d4d78aca4ec5455c3).

However, since this update a custom script I have that calls get_value on a custom child table is failing with PermissionError. I’m logged in as Administrator with explicit permissions for the parent. Anyone know how to resolve this?

EDIT: Checked the tabDocType table and the child table has no parent. In fact, no DocTypes have parents… How do I resolve this?

Turns out you need to pass parent through as an argument when calling get_value.

Good day sir, @DBoobis. May i know how did you do this? “Turns out you need to pass parent through as an argument when calling get_value”. I’m having the same error right now. I tried fetching a child table data to other doctype. Thank you in advance. :smiley:

Did you find the solution for this ?

any sample code ??

frappe.db.get_value(“Item Default”, {“parent”: row.item}, “company”, function(value) {
console.log(value);
});

is not working.