TypeError: frappe.db.get_all is not a function

What Frappe version is this Database API documentation for? This states that the following should work just fine:

            frappe.db.get_all('Sales Order Item', {
                fields: ["qty", "rate", "amount"],
                filters: {
                    'parent': my_sales_order.name,
                    'parenttype': 'Sales Order',
                    'parentfield': 'items',
                },
                parent: my_sales_order.name
            })

https://frappeframework.com/docs/user/en/api/database#frappedbget_all

However, the following error is thrown: (using frappe 12.8.4)

Uncaught (in promise) TypeError: frappe.db.get_all is not a function
    at my_function (my_javascript_file.js:16)

I would prefer using frappe.db.get_list but there is a separate permissions bug with that.

Edit: Frappe version (frappe 12.8.4) added to post

Edit 2: I understand getting child data tables is prohibited (even though this statement was made in a forum post and not in the documentation). However, I should be getting a different error in that case, no?

frappe.db.get_all isn’t available on client-side.

The link you have provided is for python API. Please use Server Calls (AJAX).

1 Like

Ah. Mistakes like these make me realize I need some more sleep! Much appreciated!

1 Like