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