No announcement yet.

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

  • 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
    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


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



      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!


      • #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]";
        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, 07:02 AM.