ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Add Contact_html & Address_html

Hello! Did not find the answer on the forum.

Please tell me how to make the fields work in the created DocType Contact_html & Address_html


I read all the articles where this topic is mentioned, but have not yet understood.
Thanks.

Hi,
Below is the script in which :

1.) Company Billing Address is field with Link type(linked to Address).
2.) Company Billing Address Display is Small Text type field

company_billing_address: function(frm){
if(frm.doc.company_billing_address !== undefined){
frappe.call({
method: ‘frappe.contacts.doctype.address.address.get_address_display’,
args:
{
‘doctype’ : ‘Address’,
‘address_dict’ : frm.doc.company_billing_address
},
callback: function(response){
cur_frm.set_value(“company_billing_address_display”,response.message);
cur_frm.refresh_fields(“company_billing_address_display”);
}

        });
    }else{
        cur_frm.set_value("company_billing_address_display","");
        cur_frm.refresh_fields("company_billing_address_display");
    }
}

Hope this will help.
Thanks

I apologize for my incompetence
Please tell me where to insert such a script
I’ll try to figure it out, and rewrite it under my DocType
Thanks in advance.

Hi,

Write this in Client Script of respective Doctype.

Thanks

hello,

you can add a field which is a link type and create another field to display the address the type will be a small text and then add a fetch from value to it and it will fetch the address automatically :slight_smile:

Since you have experience, I would like to ask you for help in setting up DocType - Respondent on our website.
ready to discuss possible gratitude.