Can someone please help me in fetching particular customer’s addess(address line 1, city, state, country and postal code) in another doctype’s print format.
I am adding customer link field in my doctype.
Thanks in Advance.
@Saditi try this:
{{ frappe.db.get_value([DocType], filters={"x":"y"}, fieldname= Column name) }}
{{ frappe.db.get_value("Material Request",filters={'material_request_type':'Purchase'},fieldname='name') }}
Thanks for replying, @ROHAN_JAIN1
Sorry for checking your reply late, but can you explain this syntax(child doctype, parent doctype, current doctype).
{{ frappe.db.get_value("Material Request",filters={'material_request_type':'Purchase'},fieldname='name') }}
Material Request is Doctype, this script should be written in parent doctype custom print format
@ROHAN_JAIN1
I have created custom doctype “Test” with custom print format and I am giving a link field to select a customer. So now I want to fetch that particular customer’s address from doctype “Address” in Test doctype.
@Saditi
{{ frappe.db.get_value("Address",filters={'address_title':doc.customer_name},fieldname=['address_line1','address_line2','city','state','pincode'],as_dict=true)}}