Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Customization
 Stock Report
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

[email protected]
Starting Member

USA
44 Posts

Posted - December 09 2003 :  18:51:38  Show Profile  Visit johnrobinson@grahamcrackers.com's Homepage  Reply with Quote
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  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
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
Go to Top of Page

jonmadrid
VP-CART New User

USA
192 Posts

Posted - December 10 2003 :  14:21:07  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
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
Go to Top of Page

[email protected]
Starting Member

USA
44 Posts

Posted - December 10 2003 :  15:41:26  Show Profile  Visit johnrobinson@grahamcrackers.com's Homepage  Reply with Quote
Works like a charm!
Thanks a TON!

--John Robinson
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00