Author |
Topic |
|
[email protected]
Starting Member
USA
44 Posts |
Posted - December 09 2003 : 18:51:38
|
I'd like the Stock Report to sort the listing by "cname" and not by "catalogid". Now I was able to go in and simply change the order of the columns to the way I want in the file shopa_stock.asp, but I also needed to change scriptresponder="shopa_addproduct.asp" idfield="cname" <--was originally "catalogid" GetInput If Action = "" or Serror<>"" Then DisplayForm Else GenerateSQL WriteReport end if ..This works, unfortunately it screws up the link as it wants catalogid there so when it executes shopa_addproduct.asp it'll be an id #. I don't mind it displaying that link later, so long as it sorts my inventory list in order by name. I can live with the screwed up change I made, would just prefer to still have that working link so I can update the inventory level easily through stock reports. Thanks! --John |
|
jonmadrid
VP-CART New User
USA
192 Posts |
Posted - December 10 2003 : 14:19:02
|
John,
You can add another variable into that page that will specify how to sort the records. Here is what you would do:
Replace this: ******* dim Idfield scriptresponder="shopa_editrecord.asp" idfield="catalogID" GetInput ... *******
With this:
******* dim Idfield dim orderfield 'New variable for field to sort by scriptresponder="shopa_editrecord.asp" orderfield="cname" idfield="catalogID" 'Define the field to sort by GetInput *******
Then, around line 84, replace this:
******* Sql = SQL & " order by " & idfield *******
with this:
******* Sql = SQL & " order by " & orderfield *******
That's it. That will now sort by the correct field, and will preserve your links in the correct format.
All the best,
Jon Madrid -------------------- Madrid Communications Web Design, Development, and Hosting www.madridcom.com
|
|
|
jonmadrid
VP-CART New User
USA
192 Posts |
Posted - December 10 2003 : 14:21:07
|
I just noticed that one of the comments in the code was on the wrong line. Should have read:
orderfield="cname" 'Define the field to sort by idfield="catalogID"
Not
orderfield="cname" idfield="catalogID" 'Define the field to sort by
Hope that didnt confuse you.
All the best,
Jon Madrid -------------------- Madrid Communications Web Design, Development, and Hosting www.madridcom.com
|
|
|
[email protected]
Starting Member
USA
44 Posts |
Posted - December 10 2003 : 15:41:26
|
Works like a charm! Thanks a TON!
--John Robinson
|
|
|
|
Topic |
|