@Randy_Lowery
My case is different that is why I said using a query.
I have a child table called Alternate Item in Item DocType, which has few items mentioned under different-2 items.
And, I have a Link field (Link to Item Doctype) in a Child Table of Sales Order.
Now, what I want is, I want to filter the records of Sales Order Item child table with reference to the Alternate Item child table.
I was using the above technique but it is throwing me error.
Here is the error message:
Traceback (most recent call last):
File “/home/vishnu/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/vishnu/frappe-bench/apps/frappe/frappe/handler.py”, line 19, in handle
execute_cmd(cmd)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/handler.py”, line 40, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/init.py”, line 901, in call
return fn(*args, **newargs)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/desk/search.py”, line 12, in search_link
search_widget(doctype, txt, query, searchfield=searchfield, page_len=page_len, filters=filters)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/desk/search.py”, line 91, in search_widget
as_list=not as_dict)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/init.py”, line 1080, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 80, in execute
result = self.build_and_run()
File “/home/vishnu/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 104, in build_and_run
return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug, update=self.update)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/database.py”, line 148, in sql
self._cursor.execute(query)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1052, “Column ‘idx’ in order clause is ambiguous”)
Regards
Ruchin Sharma