1

I am trying to update a custom field on User object from Java using soap api (Enterprise wsdl) and getting below error

[InvalidSObjectFault [ApiQueryFault [ApiFault exceptionCode='INVALID_TYPE' exceptionMessage='Must send a concrete entity type.' extendedErrorDetails='{[0]}' ] row='-1' column='-1' ] ]

Verified that user has required permission on the object and field. Any ideas on why the update is failing? Thx

Sample code below.

public void updateUsers() {}
QueryResult queryResults = connection.query("SELECT Id, Name,FederationIdentifier,custom__c FROM User where FederationIdentifier in "+idInClause);

     User[] users=null;
     if (queryResults.getSize() > 0) {
         users=new User[queryResults.getSize()];
          for (int j=0;j<users.length;j++){
            // cast the SObject to a strongly-typed User
              User user = (User)queryResults.getRecords()[j];        
              // customHT is a hashtable populated with FederationIdentifier as key and a string for value
              //customHT<String, String>=new Hashtable<String,String>; 
              customS = customHT.get(user.getFederationIdentifier()); 

              if(customS==null || customS.length()==0){
                  user.setFieldsToNull(new String[]{"custom__c"});
              } else user.setCustom__c(customS);                  
          }
     }       
     if(users!=null) SaveResult[] saveResults = connection.update(users);

}

  • 1
    please check this – Ilya Lepesh Jul 29 '16 at 19:43
  • What does your outbound SOAP message look like? – Daniel Ballinger Jul 30 '16 at 1:02
  • post your code. – superfell Jul 30 '16 at 1:37
  • Fixed it. It was due to some null objects in the update array. – NG1 Aug 1 '16 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.