Modify Search Request?

edited February 25, 2019 in Questions
Is it possible to modify a search entry before it hits the database?  I'll give an example of what we're doing below.

In our salesforce we house Store Numbers, they are formatted with 6 digits, so examples include 003904, 002112, 032394, etc.

We have a request that if a user enters "3904" that it should pull up "003904", right now it does not.  

Is there a way to add those leading 0s before the request is sent to the database?

Comments

  • edited February 25, 2019
    What kind of component are your users using to perform their search?  Reference field?  Table search box?  Search Component?
  • edited January 11, 2017
    Sorry should've specified!  It's the Search Component, not a table search or etc.
  • edited February 25, 2019
    My search component, on a Products object, is doing what you describe.  For example, I type in '048' into the search box and I get product AE048XC521EA1 returned.


    image

    How do you have your Search Component set up?  Maybe post a screen shot of that?  In mine, I have the return fields of {{Name}}, {{Id}} and {{Description}} all being returned.

    I also have mine set up to search "All Text Fields" on the Basic tab of the search component properties.

    I've not had luck modifying the search input beyond this.  We had a case with External objects where the external data source had mixed case data, but the user might type in all lower case.  It would not return that as a match.  It worked fine for standard SF objects, but not external objects.  We never figured out a way to get around this (ended up just bringing the data into Salesforce via middleware instead.)


  • edited January 12, 2017
    Hi Chandra,

    Thanks for the detailed reply.  Here is what I'm seeing:

    Doing a search for "2113", notice that the store "002113" does not show up.  Note that this is the "View All" link when searching as shown below.  This is not a table component.

    image

    image

    Doing a search for "002113", the store "002113" now comes up.

    image

    Here is how my search component is setup:

    image
    image

    Hope this helps, let me know if there is anything else that would help.

    Thanks!
  • edited January 12, 2017
    Is Store # the name field on the object?  Or a custom field?
  • edited January 19, 2017
    Hi Chandra,

    Sorry for the delay.  It is the name field on the object.

    Thanks,
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!