I am trying to call primary contact using custom script if party is customer but it’s not working. Here’s my sctipt;
frappe.ui.form.on('Payment Entry', 'onload', function(frm){
if(frm.doc.__islocal){
if(frm.doc.party_type == "Customer") {
frm.add_fetch('customer', 'customer_primary_contact');
}
}
});
Is there something I’m missing?