Can’t seem to find it anyway; is it possible to call an API to get the count of a DocType given a set of conditions?
and I get:
Field not permitted in query: count (*)
If not possible I guess I need to get all needed records in JSON and count it from there…
You haven’t mentioned the field name.
I haven’t any more idea but try and check it.
response = requests.get('https://your-erpnext-instance.com/api/resource/User?fields=["name"]&filters=[["enabled", "=", "1"]]')
data = response.json()
record_count = len(data['data'])
print("Total Record:", record_count)
Otherwise, check it.
/api/resource/User?fields=["count(name)"]&filters=[["enabled", "=", "1"]]
I hope this helps.