How to use whitelisted function in Server Script

Hello Friends,
Newbie here!

How can I call frappe.call() or a python whitelisted function in Server Script?
I want to call method erpnext.setup.doctype.sms_settings.sms_settings.send_sms to send SMS and erpnext.hr.doctype.leave_application.leave_application.get_leave_balance_on to fetch leave balance.

I appreciate your help.

https://frappeframework.com/docs/v13/user/en/guides/basics/frappe_ajax_call

@hiimkhaled Kindly refer this link.

1 Like

And is it possible to call whitelisted function from a server script (not from JS).

OK, just figure out it is so simple,

address = frappe.call(‘my_app.utils.get_address_by_tax_id’, tax_id=doc.tax_id, branch=doc.branch)

6 Likes