You need to sign in to do that
Don't have an account?

Query Contact with where clause
All,
Im trying to query tax id's from salesforce using a LinkedList of Strings.
Im am not performing it properly in batch/bulk format, so I am going over
my allotted requests for the day.
Can any help me out with this query?
Im trying to query tax id's from salesforce using a LinkedList of Strings.
Im am not performing it properly in batch/bulk format, so I am going over
my allotted requests for the day.
Can any help me out with this query?
Code:
private static LinkedList<String> queryContacts(LinkedList<String> ssns,SoapBindingStub binding){ LinkedList<String> taxid = new LinkedList<String>(); QueryResult qr = null; int count = 0; for(Iterator<String> it = ssns.iterator();it.hasNext();){ String txid = it.next(); String query = "select TaxID__c from Contact where TaxID__c="; ////////////////////////////////////// try { query+="'"+txid+"'"; qr = binding.query(query); if (qr.getSize() != 0) { for(int i =0;i<qr.getSize();i++){ SObject account = qr.getRecords()[i]; System.out.println("Retrieved account AccountNumber__c: " +getFieldValue(account.get_any(), "TaxID__c")); count++; } } else { System.out.println("Hmm...\nDid not find the account, that's strange."); taxid.add(txid); } System.out.println(count); //System.out.println("\nQuery succesfully executed."); } catch (ApiFault af) { System.out .println("\nFailed to execute query succesfully, error message was: \n" + af.getExceptionMessage()); } catch (Exception ex) { System.out .println("\nFailed to execute query succesfully, error message was: \n" + ex.getMessage()); } //////////////////////////////////////////////// } return taxid; }
read the results into a map to work out which ones you got and which ones you didn't.
"Query string cannot be more than 1000 characters"?
Since i have so many items to query for.