function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Milan Tomic 14Milan Tomic 14 

Task & INVALID_TYPE: Must send a concrete entity type.

Hello

While executing this code:

Task[] records = new Task[5];

            QueryResult queryResults = connection.query("SELECT Id, Subject, Description FROM Task LIMIT 5");
            if (queryResults.getSize() > 0) {
                for (int i = 0; i < queryResults.getRecords().length; i++) {
                    Task d = (Task) queryResults.getRecords()[i];
                    d.setDescription(d.getDescription() + " -- UPDATED");
                    records[i] = d;
                }
            }

            // update the records in Salesforce.com
            SaveResult[] saveResults = connection.update(records);

I got this error:

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

Any idea what could be wrong? :)