Announcement

Collapse
No announcement yet.

API - Limit the result set to X results?

Collapse
X
 
  • Filter
  • Time
Clear All
new posts

    API - Limit the result set to X results?

    Anyone aware of a way to limit the result set returned by the API in a search to X results?

    Re: API - Limit the result set to X results?

    By default the query object returns up to 100 records. In case you want to fetch more records you can simply change that default during object creation.

    You need more and therefore you should create the object differently with specifying the max number of records you want to fetch, please use a reasonable number unlike a very high number that will reduce efficiency.

    You need to add another parameter:

    For example, in the C# sample, we have the following:

    RangerMSP.ObjectQuery<RangerMSP.Account> accountSearch = new RangerMSP.ObjectQuery<RangerMSP.Account>();
    The above uses the default (100). To specify a different number, you should call it like this:

    RangerMSP.ObjectQuery<RangerMSP.Account> accountSearch = new RangerMSP.ObjectQuery<RangerMSP.Account>(RangerMSP .LinkEnum.linkAND, 500);
    In the above line of code you will create the same AccountSearch object as in the first case, just it will ask for up to 500 rows.

    Hope this helps!

    Comment


      Re: API - Limit the result set to X results?

      I believe so:

      VB:

      Dim ticketSearch As New CommitCRM.ObjectQuery(Of CommitCRM.Ticket)(LinkEnum.linkOR, 50)

      Comment


        Re: API - Limit the result set to X results?

        This portion is working great now. There are a few hiccups, but working on it.

        Thanks

        Comment


          Re: API - Limit the result set to X results?

          As we have never really done this I was hoping to get some examples of how others go through their processes

          Comment

          Working...
          X