Calling a method from server script

Hi everybody,
PLEASE I need an answer as soon as possible
I try to execute this method which I wrote in server script of erpnext as follows

but when I test http:/url/api/method/custom in postman it shows me an empty dictionary { } knowing that I have a list of customers already
(I want when I execute the function it will return me the list of clients)
I need an urgent answer please and thank you

please use frappe.flags to return the result

e.g
frappe.flags = frappe.get_all("Customer")

Thanks for answering,
but it still doesn’t work, it work with this
frappe.response[‘data’] = frappe.get_all(“Customer”)

2 Likes