This topic is locked
[SOLVED]

 URL to open a list and edit w/ customized search?

2/9/2004 11:03:31 AM
ASPRunnerPro General questions
B
bennettsw author

I'd like to be able to create links so that I can pass search criteria to a list or edit view.
For example, open a list where [Product Type] = "car" (or "boat", etc.)

Or, open an edit where [Account Number] = "009837408-112"
Is this possible, without modifying the ASP files directly? (I know this topic came up last year...).

If not, do you have examples of how this can be done?
Thanks!

Sergey Kornilov admin 2/13/2004

Sure it can be done.
Here is the example of opening list page with predefined search results:

<form method="POST" action="cars_list.asp" name="frmAdmin">

<input type="hidden" id="action" name="action" value="Search">

<input type="hidden" id="PageSize" name="PageSize" value="20">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="SearchField" name="SearchField" value="Product Type">

<input type="hidden" id="SearchFor" name="SearchFor" value="car">
</form>
<a href="#" onClick="document.forms.frmAdmin.submit(); return false;">Click to see results</a>


You just need to change target page name accordingly.
Here is the example of opening edit page:

<form method="POST" action="cars_edit.asp" name="editform">

<input type=hidden id="editid" name="editid" value="009837408-112" >

<input type=hidden id="NeedQuotesAccountNumber" name="NeedQuotesAccountNumber" value="True">

<input type=hidden id="action" name="action" value="edit">
</form>
<a href="#" onClick="document.forms.editform.submit(); return false;">Click to edit record</a>


I hope this helps.

501002 3/5/2004

This is great! I have created an ASP graph where the graphic bars are hyperlinks to the data set composing that bar. But I can't figure out how to use this method to query multiple fields. I tried the "Any field" option in this line:
<input type="hidden" id="SearchField" name="SearchField" value="Any field">
but I end up with "too few parameters" for an error. I would like to be able have two lines like this:
<input type="hidden" id="SearchField" name="SearchField" value="date column">

<input type="hidden" id="SearchFor" name="SearchFor" value="08-Mar-2004">

<input type="hidden" id="SearchField" name="SearchField" value="office column">

<input type="hidden" id="SearchFor" name="SearchFor" value="Los Angeles Office">
Again, this won't work either. Any suggestions would be appreciated. Thanks for a great product.
Thanks for your help!

Sergey Kornilov admin 3/5/2004

try this

<input type="hidden" id="SearchField" name="SearchField" value="AnyField">


Second method also would work if you add more parameters:

<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchField" name="SearchField" value="date column">

<input type="hidden" id="SearchFor" name="SearchFor" value="08-Mar-2004">

<input type="hidden" id="SearchField" name="SearchField" value="office column">

<input type="hidden" id="SearchFor" name="SearchFor" value="Los Angeles Office">


I hope this helps.

501003 3/5/2004

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1308&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' /> Hi Sergey, forgive my ignorance. I used the "AdvancedSearch" method you illustrated, but I still receive errors:
Error number -2147467259

Error description 007~ASP 0105~Index out of range~An array index is out of range.
When doing an advanced search, do the other elements remain the same? For example, building on the initial example, would a complete example be:
<form method="POST" action="cars_list.asp" name="frmAdmin">
<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="SearchField" name="SearchField" value="Product Type">

<input type="hidden" id="SearchFor" name="SearchFor" value="car">
</form>
<a href="#" onClick="document.forms.frmAdmin.submit(); return false;">Click to see results</a>
The "AdvancedSearch" code you listed above doesn't include the "SearchOption" line. Also, I'm assuming we are still submitting this to the list.asp page. Thank you for your help and I look forward to you reply. Kind Regards, Alex

Sergey Kornilov admin 3/10/2004

Alex,
here is the working example:

<form method="POST" action="cars_list.asp" name="frmSearch">

<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="FieldName" name="FieldName" value="Make">

<input type="hidden" id="NeedQuotesMake" name="NeedQuotesMake" value="True">

<input type="hidden" id="SearchFor" name="SearchFor" value="Audi">

<input type="hidden" id="SearchFor2" name="SearchFor2" value="">
</form>
<a href="#" onClick="document.forms.frmSearch.submit(); return false;">Click to see results</a>


Let me know if you need any help implementing this.

A
alexander 7/15/2004

I can't seem to get the method above to work in ASPRunnerPro. Has something changed in the new version the prevents the method above? Thanks Again!

A
alexander 7/15/2004

I got it. Sorry for the needless post.

Pete M 8/17/2004

Hi Sergey,

<form method="POST" action="cars_edit.asp" name="editform">

<input type=hidden id="editid" name="editid" value="<%=Session("OwnerID")%>">

<input type=hidden id="NeedQuotesAccountNumber" name="NeedQuotesAccountNumber" value="True">

<input type=hidden id="action" name="action" value="edit">
</form>
<a href="#" onClick="document.forms.editform.submit(); return false;">Click to edit record</a>


This code lets me open a record in edit view (from the menu page), but the edits are not getting saved.
It saves OK when opening the list view.
Any tips on this?
I am also trying to open a list view as though from an advanced search using 2 parameters. I need to have several links on the menu page, using different parameters:

<form method="POST" action="JobsOrderedNotApproved_list.asp" name="frmSearch">

<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="FieldName" name="FieldName" value="InspectionRequired">

<input type="hidden" id="NeedQuotesMake" name="NeedQuotesMake" value="True">

<input type="hidden" id="SearchFor" name="SearchFor" value="1">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="FieldName" name="FieldName" value="InspectionUndertaken">

<input type="hidden" id="SearchFor2" name="SearchFor2" value="0">
</form>
<a href="#" onClick="document.forms.frmSearch.submit(); return false;">All Current Jobs Requiring Inspection</a>
<form method="POST" action="JobsOrderedNotApproved_list.asp" name="frmSearch1">
<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="SearchField" name="SearchField" value="InspectionRequired">

<input type="hidden" id="NeedQuotesMake" name="NeedQuotesMake" value="True">

<input type="hidden" id="SearchFor" name="SearchFor" value="1">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="SearchField" name="SearchField" value="InspectionUndertaken">

<input type="hidden" id="SearchFor2" name="SearchFor2" value="1">
<a href="#" onClick="document.forms.frmSearch1.submit(); return false;">All Current Jobs Requiring Post-inspections</a>
</form>


The first link opens the correct page, but shows all records matching the 1st search criteria only (ie 10), when it should show 7. The 2nd one doesn't work at all.
Thanks for any tips

B
Bryan 9/29/2006

Hi there,
Further to this, I cannot get the advanced search to work either.
This is my code:
<form method="POST" action="NU_DATA_list.asp" name="frmSearch">
<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="FieldName" name="FieldName" value="File_Holder">

<input type="hidden" id="NeedQuotesFile_Holder" name="NeedQuotesFile_Holder" value="True">

<input type="hidden" id="SearchFor" name="SearchFor" value="William Gibson">
</form>
<a href="#" onClick="document.forms.frmSearch.submit(); return false;">Click to see results</a>
I can get a "search" working but not "AdvancedSearch" - it just returns all the records in the database.
The "NU_DATA_list.asp" is the list page (not the advanced search page) generated by ASPRunner.
Also, can someone please confirm what "NeedQuotesxxxxxx" does?
Many thanks,

Bryan

J
Jane 9/29/2006

Bryan,
This NeedQuotesFile is for internal use only.
If you want to get link to the LIST page with search criteria use something like this:

http://localhost:7000/temp/Products_list.a...=and&FieldName=field1&SearchOption=Equals&field1=2&FieldName=field2&SearchOption=Equals&field2=0

B
Bryan 9/29/2006

Hi Jane,
Sorry, but I can't make any sense of your reply...
I'm confused, as if I use the following code:
<form method="POST" action="NU_DATA_list.asp" name="frmSearch">
<input type="hidden" id="action" name="action" value="Search">

<input type="hidden" id="PageSize" name="PageSize" value="50">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="SearchField" name="SearchField" value="File-Holder-email">

<input type="hidden" id="SearchFor" name="SearchFor" value="john.smith@cipsolicitors.co.uk">
</form>
<a href="#" onClick="document.forms.frmSearch.submit(); return false;">Click to see results</a>
The LIST page IS displayed with any records with john.smith as the email address even though the email address field is NOT listed in the the search criteria for the LIST or ADVANCED SEARCH pages.
When the LIST box is displayed, the value "john.smith@cipsolicitors.co.uk" is in the box next to the SEARCH button (at the top).
However clicking SEARCH again (with john.smith@cipsolicitors.co.uk still in the box) returns No Results.
What i'd like to achieve is a set of reports (hyperlinks) that a user accesses from a page. When the user selects a link, it displays the results in the LIST screen based on pre-defined search criteria based on selections made in the ADVANCED SEARCH screen.
Any ideas (and preferably examples) of how to achieve this would be much appreciated.
Many thanks in advance,

Bryan

J
Jane 9/29/2006

Bryan,
as I understand you need a set of links based on the search criteria. Then you want to place this links on the LIST page, right?
The link to the LIST page after advanced search looks like:

http://localhost:7000/temp/TableName_list....Equals&field2=0

where TableName is your actual table name, field1 and field2 are your actual field name.
You can change this link, add your search criteria and then use it on the LIST page.
Also could you tell me what version of ASPRunner you use?

R
Ryan 12/3/2006

Hi,
I am trying to create a form on my home page so people can seach the list page. I have been trialling the code on this page but all i get returned is the entire list page, here is my code:
<form method="POST" action="current_flights_list.asp" name="frmAdmin">
<input type="hidden" id="action" name="action" value="AdvancedSearch">

<input type="hidden" id="SearchOption" name="SearchOption" value="Equals">

<input type="hidden" id="SearchField" name="SearchField" value="Departure City">

<input type="hidden" id="SearchFor" name="SearchFor" value="Sydney">
</form>
<a href="#" onClick="document.forms.frmAdmin.submit(); return false;">Click to see results</a>
Any assistance would be appreciated, I am using version 4.1