I can't get this sample WSC Salesforce code to work. What am I missing? I'm trying to create a new Event for a specific Account. I don't mind querying the Account first. This seems really simple, but it's not working.
QueryResult queryResults = connection.query("SELECT Id FROM Account WHERE Name = 'TEST'");
Account account = (Account) queryResults.getRecords()[0];
Event event = new Event();
[Set required fields]
event.setAccount(account);
Event[] records = new Event[1];
records[0] = event;
SaveResult[] saveResults = connection.create(records);
The error I get is
Field name provided, Id is not an External ID or indexed field for Account