AnsweredAssumed Answered

Best way to search?

Question asked by Grant Schenck on Jan 21, 2019
Latest reply on Jan 22, 2019 by Francesca Shiekh

I'm getting confused as to how to best search for records and could use some advice.  I'm using the /rest/v11/ end point.  


I have a need to find matching Accounts, Contacts and Lead that have a specific phone number in one of their phone fields.  A related need is wanting to be able to search regardless of how a number happens to be formatted in Sugar.  So, searching on 5085551212 would find "5085551212", (508) 555-1212", etc.  Finally, if possible I'd like to control which fields of the matching records are returned.


I see there is a search, globalsearch and <module>/filter and possibly others?


What is the best Sugar REST end point to use?  While I'd prefer to make one query, I can live with querying each of the three modules separately.  Similarly I can also live with  explicitly listing the phone fields I want to search to look at.  While I'd like to control the specific fields for each module type that are returned I can also live with getting all of the data for each record.


So, what is the advice and best practice?  At this point I'm playing in Postman/Curl so examples that show several requests would be really appreciated.