I am trying to generate apex class using Tooling API. In the apex class I am writing a query
[select Type, Origin, Count_of_Co_brand_card__c, CaseUser__r.City, IsEscalated, ClosedDate, SLAViolation__c, CreatedDate from Case where Id IN :recordIds]
using relationship field CaseUser__r.City
On creating the Apex class using Tooling API, I get exception in response as
"No such column 'City' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.","errorCode":"INVALID_FIELD_FOR_INSERT_UPDATE","fields":
Here, When I create apex class manually consisting same query is saved successfully. Exception I am facing is through Tooling API. Any ideas?