Frappe call for child table giving error

I am trying to call data of child table using frappe call but getting error → “You do not have enough permissions to access this resource. Please contact your manager to get access.”

Here’s my code

frappe.ui.form.on("SA", "refresh", function(frm){
frappe.call({
    method: 'frappe.client.get_value',
    args: {
        'doctype': 'Service',
        'fieldname': ["item_name","ra_1_limit","ra_2_limit"],
	filters: {
          name: 'e1a02d023c',
        }
    },
	async: false,
    callback: function(r) {
        console.log(r.message)
    }
});
});

service is the name of my child table and sa is the doctype where i want to access the values

1 Like

Check whether login user have access to Service doctype.

i’m logged in as administrator

any help ?

again tried the complete procedure on another instance but still the same Permission error

Go to Doctype → your doctype
Check under Permission Rules if any roles assigned. At least should have System Manager.

Already exists in parent. Here’s the screenshot

Also noticed, there’s no permission rule in child table I’d created

Try to add role in child table and see if it’s solved.

How to do so ??

Coz in role permission manager, i can’t find my child doctype and there’s no permission rule in child table

This is not related to any role or permission.

you need to pass - parent in your args i.e. parent doctype of the child table

e.g.

  args: {
	'doctype': 'Service',
	'fieldname': ["item_name","ra_1_limit","ra_2_limit"],
	'parent': 'Parent DocType',
	filters: { name: 'e1a02d023c' }
},

edit: reference -

7 Likes

thanks