This topic is locked

Search is not working on List page

10/14/2025 12:04:33
ASPRunner.NET General questions
M
MSchell author

Using MultiDev build 43602

On my list page, in one project search will display the search value in red, but not only display the items that meet the search criteria, in another project, it doesn't work at all.

What can cause Search to not function correctly?

ChatGPT 10/14/2025

When dealing with search functionality in ASPRunner.NET and facing issues like the search not working correctly in one project while it does in another, there are several factors to consider:

  1. Database Connection: Ensure that the database connections are set up correctly in both projects. If the connection strings differ or if there are issues with the database itself, the search functionality may not work as expected.


  2. Search Settings: Check the search settings in the ASPRunner.NET project. Make sure that the fields you want to search are set to be searchable. You can verify this in the "Search" settings of your fields in the project settings.


  3. Field Types: Ensure that the field types in your database correspond correctly to the types defined in ASPRunner.NET. If you are trying to search on a field that is not indexed or is of an incompatible type, it may cause issues.


  4. Filters and Criteria: Review any filters or criteria that may be applied to the list page. If there are restrictions that limit the results, the search might not return any items even if they meet the criteria.


  5. JavaScript Errors: Check the browser console for any JavaScript errors that may be interfering with the search functionality. Sometimes, front-end scripts can prevent certain actions from executing.


  6. Caching Issues: If you have caching enabled, clear the cache to see if that resolves the issue. Sometimes stale data can cause unexpected behavior.


  7. Permissions: Ensure that the user permissions are set correctly. If the user does not have permission to view certain records, the search may not return those results.


  8. Version Differences: Since you mentioned you are using MultiDev build 43602, ensure that both projects are on the same version of ASPRunner.NET. Different versions might have varying functionalities or bug fixes related to the search functionality.


  9. Code Customizations: If you have made customizations to the code in the working project, ensure that similar customizations have not inadvertently broken the functionality in the non-working project.


  10. Compare Configurations: Finally, compare the project settings and configurations of both projects side by side. Look for any discrepancies that might explain why one project behaves differently than the other.



By systematically checking these possibilities, you should be able to identify what is causing the search functionality not to work correctly in one of your projects.

M
MSchell author 10/14/2025

This code on the list page before SQL query to allow these two groups to see all records, if I comment this out, then Search works, with it it does not. I need these groups to see all records, but search should work also?

if (XSession.Session["UserGroup"] != "Support" || XSession.Session["UserGroup"] != "HRBP" )
{strWhereClause = "CreatedBy = '" + Security.getUserName().ToString() + "'";
}

E
Eric Chan 10/14/2025

Your logic has mistake and could be further simplfied...

if (XSession.Session["UserGroup"] != "Support" && XSession.Session["UserGroup"] != "HRBP" )
{
strWhereClause = "CreatedBy = ':user.username'";
}

M
MSchell author 10/15/2025

Eric, thank you