I’m a fan of hack-ish solutions, so here’s something you might try…
Instead of passing the actual customerid from the database, pass a relative ID. What I mean is, if the user can view these four links:
link 1: http://www.abc.com/index.cfm/customer/home/customerid/555541
link 2: http://www.abc.com/index.cfm/customer/home/customerid/348541
link 3: http://www.abc.com/index.cfm/customer/home/customerid/11141
link 4: http://www.abc.com/index.cfm/customer/home/customerid/84248
Instead give them:
link 1: http://www.abc.com/index.cfm/customer/home/customerid/1
link 2: http://www.abc.com/index.cfm/customer/home/customerid/2
link 3: http://www.abc.com/index.cfm/customer/home/customerid/3
link 4: http://www.abc.com/index.cfm/customer/home/customerid/4
The new relative customerid just represents which actual record to use when the page is called.
So, when the page that displays the record is loaded, simply use the relative ID (1 - 4) to choose the corresponding row from the records available to the user. If the user sends in customerid 3, then get the third row from the query of customers belonging to the user.
Every user would have:
If a user has 50 available customers, they have customerid/1 through customerid/50, the ACTUAL customerid wouldn’t matter at all.
Now, of course, new records could get inserted or deleted between when the list loads and when the link to view the customer is actually clicked, which could result in a mismatch of the index number (the relative customerid) to the list of available customers, which would result in the wrong information possibly being displayed. The contingency for this is to:
1.) cache the query for a period of time that matches the longest possible time the list can be displayed (not required if you do steps 2, but will still help)
2.) create an array or simple list in each user’s session that holds a list of their
customerids, so: 555541,348541,11141,84248. This way, when you pass in the relative customerid (1,2,3,etc) you can simply get the element from the list at that index and display it. The clever part about this is that if any records are added or deleted, that’s ok. The list is in the session and contains only the exact list that corresponds to the list that was displayed in the browser. The list in the session won’t be changed until the next call to the list page.
If the number of records is large, simply keep the query stored in the session instead of an array or list, and use the same method of using the relative customerid to get that corresponding row from the query stored in the session (which gets updated the next time the list is loaded, and would then reflect new insertions and deletions).
Hope this helps! (Even just for fun if you don’t want to use this kind of thing in production)