+ Start a Discussion

Search Criteria in URL

Anyone know of a way to add the search criteria of two fields in the url? IWhat I have so far is below from my VF page


function search()
   var searchStr = document.getElementById('txt1').value + '*';
   window.open('/ui/product/Search?search=' + encodeURIComponent(searchStr), "_parent" );


I want to add another field to search on which is a custom field.  How can I designate the existing to search the name field of the product object and add another criteria to search another field? For example the name is the Product Name.  I have a custom field called Site.  I will add another entry field on my VF page to seperate the two and I want to search on the two like I can from the product object with two filters.


Have you considered constructing another Visualforce page that uses SOSL in its controller?  The way you are doing it might work for simple scenarios, but is not guaranteed to work for ever.  Product URLs are not part of API and could change in a future release breaking your code.