Try ERPNext Buy Support Partners Foundation

How to check two filed from different doc?

Hi Team,

In my situations i want to check the two values in of customer and company doctype. the filed name is same that is tax_id so how compare this two filed from different doc?
compare tax_id of customer == tax_id of company if this true then print …Instate otherwise else
print("outstate ) like this i want so which way to solve this.is anyone know this please help

Thanks

In py file you can do like this
customer_doc = frappe.get_doc(‘Customer’,‘name’)
company_doc = frappe.get_doc(‘Company’,‘name’)
if customer_doc.tax_id == company_doc.tax_id:
print(“Instate”)
else:
print(“outstate”)

1 Like

ok will try and let u know

thanks