hello!
i am new to frappe erpnext and i am shifting my admin panel to erpnext by api’s.
i want to join three doctypes on some condition to get data to save time by rest api php.
but i don’t found any help to get data by join.
any help will be appreciated.
Thanks
Hi @Arslan_dixeam,
One way to accomplish this is by writing a custom API.
- Write a SQL query (with joins) that produces the results you need.
- Create a new function in your App.
- Within your function, call the SQL query:
result = frappe.db.sql(<your_query>)
- Transform your result as necessary. Then return the result.
- Make your function accessible by decorating it with
@frappe.whitelist()
You can then call your function using the REST API.
GET https://yourdomain.com/api/method/path.to.your.function
See this documentation for more details:
https://frappeframework.com/docs/user/en/api/rest#remote-method-calls
1 Like
thanks @brian_pond . i am trying this way.