nikzz
September 24, 2018, 1:37pm
1
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
Sangram
September 24, 2018, 1:49pm
2
Check whether login user have access to Service doctype.
nikzz
September 24, 2018, 1:51pm
3
i’m logged in as administrator
nikzz
September 25, 2018, 5:46am
5
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.
nikzz
September 25, 2018, 6:04am
7
Already exists in parent. Here’s the screenshot
nikzz
September 25, 2018, 6:10am
8
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.
nikzz
September 25, 2018, 6:19am
10
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
Sangram
September 25, 2018, 6:22am
11
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 -
return frappe.get_list(**args)
@frappe.whitelist()
def get_count(doctype, filters=None, debug=False, cache=False):
return frappe.db.count(doctype, get_safe_filters(filters), debug, cache)
7 Likes