Try ERPNext Buy Support Partners Foundation

Filter is not working on return of a db values in latest version

Am using a query to list down values in a field, but am typing some related letters not working.
i tried the following but no helps Filters is not working
working idea are welcome…!!!

Can you share the code both JS and Python.

You can find a number of examples in regarding this.

@root13F this is py query - return frappe.db.sql(""“select name from tabItem i where i.{key} LIKE %(txt)s and {cond}”"".format(key=searchfield,cond=cond),{
‘txt’: “%%%s%%” % frappe.db.escape(‘txt’)})

js function:
frm.set_query(“item_code”, “items”, function() {
return {
query: “formulation.overrides.override_manufacturing_bom.item”,
filters: {‘doc’:frm.doc.item}

i want to know what does txt does in query…on using the above code am getting empty set.

return frappe.db.sql("""select name,item_name,item_group from tabItem where parent_item_group in (“Raw Material” , “Packing Material”) and inspection_required_before_purchase=1
and is_default=1 and name like {txt}""".format(txt = frappe.db.escape(’%{0}%’.format(txt))))