Added Subsidiary for Customer

I added a subsidiary doctype which contains subsidiary name( A customer name from the customer list), a parent customer(also from the customer list) , primary contact and primary address linked to the subsidiary name.

Now in quotation, I want to add the subsidiary names which is under the parent customer on the customer address field.

I am at lost on how to code it in the custom script as I cannot find how to insert it.


Is it possible to add multiple values on linked name?

You can override the filter of “Customer Address” field from client script

For reference

frappe.ui.form.on('Quotation', {
	customer: function(frm) {
		frm.set_query('customer_address', function(doc) {
			return {
				filters: {
					'link_doctype': 'subsidiary',
					'link_name': doc.customer
				}
			}
		})
	}
});

update it accordingly

1 Like

Thanks for the reply, I will try this one.