Help with Custom Button with Doc Field Value

Hello,

I’m trying to add a custom button in Customer Doctype to open one external url. I need to get the value of one customer doctype field to build the url.

I’ve created with custom client script to display one button at the top of the Customer Doctype with a fixed url but I don’t know how can I include the field value at the end of the url.

frappe.ui.form.on('Customer', {
	refresh(frm) {
	frm.add_custom_button("Link", function(){
			var myWin = window.open('https://domain.com/CUSTOMFIELDVALUE');
	});
	}
})

How can I insert the value of one customer field at the end of my url?

Thank you.

frm.doc.fieldname in place of CUSTOMFIELDVALUE should work.

Thank you for you help!

I will try it.