• Esha Sharma 4
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
  • 3
        I am trying to save a content version document.Below is what I am doing 

      qr = partner_connection.query("SELECT VersionData from ContentVersion WHERE ContentDocumentID = '" + id + "'");
        System.out.println(qr.getSize() > 0);  //returns false.
Below is what I am doing

 String queryStr1 = "SELECT CaseNumber,ID, SM_Change_Area__c FROM Case" + " WHERE  SM_Change__c in ('Standard', 'Minor')  AND SM_Change_Area__c in ('Database - Select Script', 'Database - Database Edit Script')" + " AND Status in ('Peer Approval', 'Pending Eng Peer Approval')" ;
            qr = partner_connection.query(queryStr1);

            if (qr.getSize() > 0) {
            for (SObject c:qr.getRecords()) {               
                    caseNumber = c.getField("CaseNumber").toString();      
                    System.out.println(caseNumber); //gives me the caseNumber
                    QueryResult qr2 = partner_connection.query("SELECT SM_Data_center__c,ID from SM_Change_implementation__c where case__c='" + c.getId() + "'");
                    System.out.println(qr2.getRecords()[0].getSObjectField("SM_Data_center__c")); //gives me null 

I can see qr2.getRecords().toString() prints the entire XML object and it has this field and value. 
My project was accessing a lower salesforce API. To access some relationships which were present in a higher API, we changed the endpoint url to /Soap/u/43.0/ and generated partner wsdl from the xml. However after I include that in our project, it has unresolved references for SoapBindingStub and SForceServiceLocator. I can see the new jarfile is missing these classes. How can I resolve these references?  

I generated jar using https://github.com/forcedotcom/wsc.