FrappeClient call to api vs REST call to api

Hi Experts,

Im experiencing a strange thing.

I have a custom app installed together with ERPNext. I have created a def where I apply some logic and create entried in a custom table and in the Customer tables using the frappe.new_doc methods. All good here cause I have tested this with the REST api calling the method and entries are created as expected. I have also added a button on a form to test if I can run my method via javascript calling the frappe.call method and all is good.

Now I created a python file that I use to test for when I need to use FrappeClient to call the api from an external application, and here is where the challenge lies. Im using the same api and access and I get a message that the customer is created, but when I go an look there is not customer? Am I missing something - cause this is very strange. How can I debug this or what do I look for to help me identify whats wrong?

Let me know if you needs more info - in the mean time im going to do an try a few other tests.

regards
Hemant

try frappe.db.commit() after creating the customer or check the customer permissions.

Hi @makarand_b

frappe.db.commit() worked perfectly, thanks.

regards