frappe.call({
type : 'POST',
method:'example_json',
args: {
filters: {
posting_date : "2021-08-01"
}
},
i am trying since long to pass parameter but it is not work…waiting for the help!
def get_test1_api(posting_date):
frappe.msgprint(posting_date)
return frappe.db.sql(“”“SELECT name FROM tabSales Invoice
WHERE customer_gstin=‘000000000000’”“”)
Hi @Rehan_Ansari
can you share .py and .js file here
You can pass arg like
args: {company: report.get_values().company,`
thank you for reply…still getting same error
like comany is not defined
replce the args as per your syntax but getting same error
screenshot py file contains example_json method, please
In example_json file there is a method called get_test1_api()
seems this PR may help you understand api call to server script, it is only for develop branch at the moment.
Hello @Rehan_Ansari,
If you can share more details what you are trying to achieve then someone can give you pointer for that.
Also if you can share code instead of screenshot will help us to understand what you trying to achieve.
this is js file:
frappe.call({
type : ‘POST’,
method:‘example_json’,
args: {
filters: {
posting_date : "2021-08-01"
}
},
i am trying to pass posting_date to python server but it showing error that posting_date not defined
my python code:
def get_test1_api(posting_date):
frappe.msgprint(posting_date)
return frappe.db.sql(“”“SELECT name FROM tabSales Invoice
WHERE customer_gstin=‘000000000000’”“”)