Forums: How to trim search values before search is conducted? - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to trim search values before search is conducted?

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15433
  • Joined: 03-February 03

Posted 27 April 2017 - 02:18 PM

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

Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic