function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
unikevinunikevin 

Duplicate records

I am using Java toolkits for  API6 .  I try to get about 5,000 records via Sforce and it returns many duplicate records,but these records in the system are unique. it means the same record is returned several times..
 
anyone can help me? thanks.
 
the code below:
 
Code:
   boolean keepLooping = true;
   while (keepLooping) {
    for (int i = 0; i < qr.getRecords().length; i++) {
     MessageElement[] records = qr.getRecords(i).get_any();
     HashMap fields = new HashMap();
     if (qr.getRecords(i).getId() != null)
      fields.put("Id", qr.getRecords(i).getId().getValue());
     for (int j = 0; j < records.length; j++) {
      MessageElement record = records[j];
      if (!fields.containsKey(record.getName()))
       fields.put(record.getName(), record.getValue());
     }
     returnVal.add(fields);
    }
    if (qr.isDone())
     keepLooping = false;
    else
     try {
      System.out.println("************QUERYMORE*********");
      qr = binding.queryMore(qr.getQueryLocator());
     } catch (UnexpectedErrorFault e) {
      e.printStackTrace();
     } catch (InvalidQueryLocatorFault e) {
      e.printStackTrace();
     } catch (RemoteException e) {
      e.printStackTrace();
     }
   }