Skip to main content
January 14, 2025
Question

How to fetch the grid result by removing "- "

  • January 14, 2025
  • 5 replies
  • 0 views

HI All,

while case creation user will add policy number like this  12345675-7896  but when storing to DB  will remove the "-" and will store only 123456757896

but while in the home page user filtering the record using 12345675-7896 the results will display null

Could you please suggest me the better solution.

Thanks in advance.

    5 replies

    mathieud0001
    January 14, 2025

    Possible you're saving it in an integer field?

    If you want to keep the dash, I would suggest changing it to a Text field.

    If you can't do that, another option would be creating a custom text Record field that inserts the dash at that position and change the column and search filter to point to that new field.

    January 15, 2025

    Thanks Mathieu,

    Yes,we are using text field for storing but not storing with "-" to DB. 

    Again, user will search sometimes with "-" and sometime he will search without "-" as well as and we will get 5 to 6 filed like this format while case creation time . is it only possible to achive with custom text Record field ? do we have any other alternative solution for this?

    Thanks in Advance.

    mikes0011
    Brainy
    January 15, 2025

    Are you saying the DB field can only contain numbers?  Because if that's how it works, then it should be pretty easy to take the user's filter input and remove anything non-numeric before passing it to the query.

    January 15, 2025

    Hi Mike,

    yes,DB will store the number alone, we are using record search box in grid field And record search we can't remove the "-" from given value.

    apart of custom text Record field option is there any solution we can do? 

    Thanks in Advance.

    mikes0011
    Brainy
    January 15, 2025

    Are you required to use the Record Search Box?  Because with a manually-defined search box, this would be trivially easy to handle.  I'm not sure how you'd handle it using the Record Search, though i suppose there might still be a work-around I'm not thinking of.