How to get all fields and values of any record

Hello Community,

I am stuck in python code. :confused:

I got customer doc in my “cust” variable using below code
cust = frappe.get_doc(‘Customer’, order.customer)

but, I want all fields and its values.
I try below code but it returns only name of a customer.
cust_all_fields_values = frappe.db.get_value(“Customer”, filters="{‘name’: ‘Customer1’})

so, please can anyone suggest me what can I do for that.

Thanks in advance

Try get_values() instead

frappe.db.get_values("Customer", {'name': 'Customer1'}, "*", as_dict=True)


Thank you @Sangram :slight_smile:
I got all fields and values of a doc. :thumbsup: