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);

}

4
  • 1
    please check this Commented Jul 29, 2016 at 19:43
  • What does your outbound SOAP message look like? Commented Jul 30, 2016 at 1:02
  • post your code. Commented Jul 30, 2016 at 1:37
  • Fixed it. It was due to some null objects in the update array. Commented Aug 1, 2016 at 12:46

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.