Announcement

Collapse
No announcement yet.

error when using search (any type of search, advanced, quick)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • error when using search (any type of search, advanced, quick)

    I was implementing an advanced search on a grid application today, and whatever search field I used, or even if I use the quick search input field, I will always get the popup error displayed in the attached images!

    This happens only in this specific application, I tried everything and nothing seems to solve the issue.

    It happens as soon as you define search criteria (or write something in the quick search box and press enter), and it pops as soon as you hit "Search" or if you have onChange submit, as soon as you make a selection!

    Please help


  • #2
    Ususally I have these errors when:
    1 - the select is too complicated for SC to manage
    and\or
    2 - Fields are removed from the SQL select statement but are still included in the search settings

    case 1 can be solved by moving too complex SQL select statements to DB views
    case 2 by ediiting which fields are included in the search

    Comment


    • #3
      that was it, thank you very much,

      basically

      sc_select_where(add)

      doesnt work with search!!

      So what I did is, add in my SQL statement a WHERE 1 = 1,

      then use sc_select_where(add) to call " AND myVar = mySecondVar" instead of "WHERE myVar = mySecondVar"

      so as long as you dont use the WHERE inside sc_select_where(add), it will work!

      Comment


      • #4
        If that was the case, I think the SC manual gives you some hints.

        if (empty({sc_where_current}))
        {
        sc_select_where(add) = "where campoX > [global]";
        }
        else
        {
        sc_select_where(add) = "AND campoX > [global_variable]";
        }
        But I had some issues with sc_select_where as well in the past and basically I try not to use it anymore as it frequently broke the app during search or other functions
        Last edited by robydago; 02-07-2019, 08:02 AM.

        Comment


        • #5
          I simply can not understand the solution without examples. We all interpret things differently but examples lay things out regardless of the "misinterpretations".
          I am running into this problem "ALL THE TIME" .... on grid searches with multiple search fields and search criteria set to "OR"... anyone seeing the same?.
          I pasted the error since for some reason I can't attach pics or documents to the site. Error below...

          Empleado: Igual a 500
          Fatal error: Uncaught ArgumentCountError: Too few arguments to function grid_timex_incidencias_main_grid::grid_search_tag_ end(), 0 passed in C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\grid_timex_incidencias_main_grid.class.php on line 8072 and exactly 2 expected in C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\grid_timex_incidencias_main_grid.class.php:8226 Stack trace: #0 C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\grid_timex_incidencias_main_grid.class.php(8072 ): grid_timex_incidencias_main_grid->grid_search_tag_end() #1 C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\grid_timex_incidencias_main_grid.class.php(254) : grid_timex_incidencias_main_grid->html_grid_search() #2 C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\index.php(3605): grid_timex_incidencias_main_grid->monta_grid(0) #3 C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\index.php(6839): grid_timex_incidencias_main_apl->controle() #4 {main} thrown in C:\xampp\htdocs\intelixm\grid_timex_incidencias_ma in\grid_timex_incidencias_main_grid.class.php on line 8226

          Comment


          • #6
            Javier, try deleting you lookups in the grid. I have those errors aswell when i use lookup. ONce you know where the error occurs, try changing your SQL code for the lookup. Keep this simple. This works for me.

            Comment

            Working...
            X