This topic is locked
[SOLVED]

Displaying single record and details after a search...

9/30/2022 11:47:30 AM
ASPRunner.NET General questions
D
david powell author

Hi,
I am new to asprunner, but have completed my first app which is working fine.... except the users are complaining about the number of clicks to display a customers information!

What they would like, and I am struggling to implement it, is that when they search on the 'customers list page' (using a simple_search), is

  • if a single match is found the master is displayed with details pages shown below (without the need to click on the 'details' icon first).
  • if multiple matches are found, the list is of customers (without details pages only visible as icons).

I have the list page made with master and details pages attached, icons showing number of items within each.

Where I am struggling despite much experimentation and googling is both in automatically showing details pages expanded, and how to count the result of the simple_search.

The logic of what I want to do is

search-> single match -> display matching master - > programmatically expand details tables
or

search-> multiple matches -> display list of matching masters -> user chooses to expand details tables of selected header.

I would be grateful for any guidance or pointers towards documentation I am missing.....

Many thanks!
David

P
pmuckleDevClub member 9/30/2022

Sorry I can't answer your question, but the way I find my equivilant data is to use the search for customerID only, if it is known, to go straight to a record.

If they don't know the ID, I use filters to locate the record, usually country, region, office etc, then customer name. At least this way the user just has to click on what they want.

There can be more than one details table, maybe that is why it has to be selected before opening.

Sergey Kornilov admin 9/30/2022

Not 100% clear what you want to do if your search returns more than one record.

In regards to expanding the details of a master record - check example #4 in Control inline Add/Edit functionality article.

D
david powell author 9/30/2022

Thanks for the replies - I will look at that link.

If there is more than one match, display a standard list of those matches with details contracted .... user can either re-search or else expand the details table on the chosen entry.

I have playing around with the idea of if one match capturing the id number and using that to populate a dashboard to replace the details tables. what event might allow me to capture a rowcount or equivalet , after the search but before the list is displayed?

Sergey Kornilov admin 10/1/2022

Using Before SQL Query event you can capture the current SQL Query, execute it manually, see how many records it returns. If it returns exactly one record, you can get that master record ID, redirect user to the corresponding page and expand the details automatically. Some coding will be required obviously.

D
david powell author 10/4/2022

Thank you! Great, that would work.