How to enable filter/Seach in Line Items page

Hi All, I went to studio to enbale filter field in line items module but it doesn’t work. Any body have a solution for searching line item by part number or line name?
Thanks for your help
Khoa

1 Like

Hi, @hckhoa!
Welcome to community!

It’s impossible to do in Studio for this module. The module ‘Line items’ is very specific. You should write special code for this filter.

1 Like

No direct way to do it. You need to play with the code. And this can be done by any experienced developer. If you feel confident you can also play with the code.

Does anyone have the solution and the sequence of steps to achieve this by code?

Hi, @Espial !

  1. Copy the file:
    “modules/AOS_Invoices/metadata/SearchFields.php” to user directory
  2. Look at the “favorites_only” field and use it as an example.
  3. Write the “line_items” field as a new array in the “SearchFields.php” field.
  4. Write a correct SQL query for the “subquery” key of the “line_items” array. The string ‘{1}’ will be replaced with the data from the search form.
1 Like

Thank you very much, I’ll try it and tell you