How to improve the Find Pump (All Customers) screen

greenspun.com : LUSENET : SmartPart Development : One Thread

now the http://centrex/Ceetak/cgi-bin/x5AkTY45/FindPump/findAllResults.asp page shows the customer name alongside the pump details for an 'all customer' search the pump has to be identified from the universe of all customers when following the link in the 'Asset Number' column. This link, e.g. http://centrex/Ceetak/cgi-bin/FindPump/pumplist.asp?id=000002,,,222222 kicks off the pumplist.asp page, and generally will get the right pump details, the only 'odd' think about the pump details is the customer code at the tope has now mysteriously switched to '%'.

The problem is that if two customers have a pump with the same asset number and serial number, the pump details screen will pick up the pump of the first customer. This is bound to happen sooner or later.

-- Anonymous, February 20, 2002

Answers

The stored proc that is called by the referring page (i.e. http://centrex/Ceetak/cgi- bin/x5AkTY45/FindPump/findAllResults.asp,which calls SP_FINDPUMPALL) will have to return not only the customer name, as displayed in the 'Customer' column but also the AccCode for the customer. This AccCode will have to be passed to the pumplist.asp in an additional query field (e.g. AccCode=XYZ). Note that the /cgi- bin/FindPump/pumplist.asp can be called from the admin search page and a single-user page, so it will be necessary to examine the AccCode session variable and override it with the query variable in the case that the AccCode is '%'. This will fix the display of a literal '%' in the cust code field too.

-- Anonymous, February 20, 2002

I had coded as recommended before receiving your email.

By the way - the email notifications from lusenet should have a link to this reply page, if possible (currently there is only a delete link).

-- Anonymous, February 20, 2002


I have made some corrections (attached files), and tested as far as I understand the code: x5AkTY45/findpump/findAllResults.ap Saves the selected customer name in session("customer") Uses this in the SP_FINDALLPUMPS proc call instead of session ("AccCode") When no rows are returned, it now redirects to find.asp - findall.asp was the original value (caused a 404) x5AkTY45/findpump/find.asp Removed the "(level 3)" part of the "All customers" select item

This is from nm's email.

I propose to call this change 002.

-- Anonymous, February 21, 2002


Moderation questions? read the FAQ