Sage 300 Web API case insensitive search

SOLVED

Hello,

I need to do a customer search using the Sage 300 Web API, but it needs to be case insensitive as some customer names are proper and some are in all caps.  According to the OData documentation I should be able to use the tolower function, but I get an internal server error if I try this.  Here is what my call looks like...

http://localhost/Sage300WebApi/v1.0/-/SAMLTD/AR/ARCustomers?$filter=startswith(tolower(CustomerName),'david')

This should return customers with the CustomerName 'david', 'David', 'DAVID' or even 'dAvid' (if it existed).

The startswith works fine, and I tried using the tolower by itself and I get the Internal Server Error 500 so I know it must be this particular function that it doesn't like.  So how can I do this kind of search?

Any help is much appreciated.

Thanks,

Ryan

  • 0

    Hi ,

    Thanks for reaching out. Did you ever find a resolution to this issue? If you are still looking for guidance, please let us know and we can try to point you in the right direction or suggest some resources or next steps.

    Warm Regards,
    Erzsi

  • +1 in reply to Erzsi_I
    verified answer

    Thanks for the follow up.  I worked around it with a few 'or startswith()' clauses with 'as typed', upper, lower and proper.  It's not 100% fool proof, but it works well enough for us.  Here is an example...

    /AR/ARCustomers?$filter=startswith(CustomerName,'david') or startswith(CustomerName,'DAVID') or startswith(CustomerName,'david') or startswith(CustomerName,'David')