Create a doctype with two fields:
-
customer
Link to Customer -
contact
Link to Contact
when in js
frm.set_query("contact", function(frm, cdt, cdn) {
var d =locals[cdt][cdn];
console.log(d)
return {
filters: [
["Dynamic Link", "link_doctype", "=", "Customer"],
["Dynamic Link", "link_name", "=", d.customer],
]
}
});
This produce this error
OperationalError: (1052, "Column 'idx' in order clause is ambiguous"
similar to : Fetch phone number script no longer working (since v8?)
What is the proper way to simple filter Contacts based on Customer ?