Posted: 19 Oct 2015 11:57 EDT Last activity: 30 Oct 2015 11:34 EDT
Customize repeat grid column filter
We have a request from our customer to be able to filter a repeat grid column without exact match in the search text. In this case we have a SSN column and they do not want to have to type the hyphens in the search text, they want that to be optional. They also want the filter search text to be a begins with search; for example "1234" in the box would return 123-45-6789 and 123-48-7654 and any others that start with 123-4. Is this possible?
It seems like we should be able to do this, because we know that the item in the database is in the format of precisely 123-45-6789. Perhaps we can strip all non-number characters from the input string, then add in hyphens in the appropriate place before passing it over as a filter for the results.
This approach will only work if they're searching from the start of the string, though - it won't work for the middle of the string since we'd be adding hyphens to the wrong places.
Okay. Since report definitions (or feeding a RD into a grid) don't actually have the functionality we want here, you'll need to use a crafted CONNECT-SQL setup (even though we're just connecting to the pega database) This will allow us to manipulate things however we like before querying the database. Since we're just looking, but we expect more than one result (sometimes) then we'll want to use the BROWSE operation. Open is better if you always expect to find exactly one item (perhaps you would rather the user type in an exact match of a SSN instead - Open would be appropriate) but that might not happen if a user isn't inputting sufficient digits of the SSN to come up with a unique match. I assume that when they input say, the first 4 digits, you'll want to give them a list from which they can select the correct item, for example.