This topic is locked

How to trim search values before search is conducted?

4/27/2017 10:18:45 AM
ASPRunnerPro Tips and tricks
admin

Q: Our user paste into the search field, and if there there are trailing blanks search returns nothing. How to trim search values before search is conducted?
A: We can use Search API for this purpose. It will work with both search panel and Advanced Search. Code goes to AfterTableInit event.
In this example table name is "Cars" and field name is "Make". Change it accordingly.

set srchObj = getSearchObject("Cars")

value = srchObj.getFieldValue("Make", null)

srchObj.setFieldValue "Make", Trim(value), null