6 Replies Latest reply on Aug 26, 2015 2:11 PM by Misi Mladoniczky

    User Tool and API difference

    Karthick Krishnan
      Share This:

      Remedy User tool is displaying only 5000 records, as this is the max limit set in the server information. But using java api, i could retreive all the records. Is it a bug with the remedy application or is it an additional feature of api?

        • 1. User Tool and API difference
          Misi Mladoniczky

          Hi,

           

          The API should not be able to bypass the server set limitation, less changing the server setting, which only admin-users can do.

           

          What you can do though, is to do multiple searches stepping the firstretrieve-parameter forward. In that way you can retrieve all the records anyway. You can do that in an API-program, but the normal user clients does not support that.

           

                  Best Regards - Misi, RRR AB, http://rrr.se

          1 of 1 people found this helpful
          • 2. User Tool and API difference
            Laurent Matheo

            I just tried testing with "getListEntryObjects" and it respects the parameter I've set "Max-Entries-Per-Query: 4" in 7.6.04 sp2 even "forcing" the max number of retrieved elements:

            List<Entry> entryList = lo_server.getListEntryObjects(formName, qual, 0,Constants.AR_NO_MAX_LIST_RETRIEVE,sortOrder, fieldIds, true, nMatches);

             

            After the query, nMatches reports 19 (total record number), though the list itself only contains the first 4 data as required (entryList.size() is 4).

            1 of 1 people found this helpful
            • 3. User Tool and API difference
              Karthick Krishnan

              Hi Laurent.,

               

              Do you think the nMatches count to be a  bug? shouldnt it be restricted to 4? Whats your opinion on the same?

               

              Regards

              Karthick

              • 4. Re: User Tool and API difference
                Laurent Matheo

                Hi

                 

                Well I think it's ok (not a bug) actually since you would want to know what is the "real" number of records. If the nMatches is different from entryList.size() you would indeed know you need to "loop" to get all records and as Misi said, use the "firstRetrieve" parameter for this:

                First time (will return records from 0 to 3):

                List<Entry> entryList = lo_server.getListEntryObjects(formName, qual, 0,Constants.AR_NO_MAX_LIST_RETRIEVE,sortOrder, fieldIds, true, nMatches);

                 

                Second time (to get from records 4 to 7):

                List<Entry> entryList = lo_server.getListEntryObjects(formName, qual, 4,Constants.AR_NO_MAX_LIST_RETRIEVE,sortOrder, fieldIds, true, nMatches);

                 

                If nMatches was returning the same value as entryList.size() you wouldn't know if you had all records or just a fragment.

                • 5. Re: User Tool and API difference
                  Stefano Omini

                  Hi all,

                  sorry for re-opening this old discussion.

                   

                  I found this page, while troubleshooting for a very similar need (which I described in a separate discussion thread: Is there any limit of maxRetrieve parameter for getListEntryObjects method? ).

                   

                  Is there any way of using Java APIs, in order to override the limit on the maximum number of returned objects (provided this is feasible, since Misi Mladoniczky suggests this should not be possible without admin privileges) or at least to read how that limit is currently configured?

                   

                  Thanks

                  Stefano

                  • 6. Re: User Tool and API difference
                    Misi Mladoniczky

                    Hi,

                     

                    You should always be able to get everything using multiple calls and specifying the first-retrieve parameter. Look for the return message indicating that all objects were not returned after each call.

                     

                           Best Regards - Misi, RRR AB, http://rrr.se