We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.debug( new Query(Case.SObjectType) .addPolymorphicFields(Case.OwnerId) .getQuery() );
result:
SELECT CaseNumber, Id, Who.Alias, Who.Email, Who.FirstName, (a lot of Who.X fields) FROM Case
Obviously, such a query will fail. Result with getResults(): System.QueryException: Didn't understand relationship 'Who' in field path. (...)
getResults()
System.QueryException: Didn't understand relationship 'Who' in field path. (...)
The same happens if there is a Who relationship on the queried SObject, but we choose a different field, which is ignored:
Who
System.debug( new Query(Task.SObjectType) .addPolymorphicFields(Task.WhatId) .getQuery() );
SELECT Id, Subject, Who.Alias, Who.Email, Who.FirstName, (a lot of Who.X fields) FROM Task
This query won't throw an exception, which is even worse, since is silently skips the field we expected to be queried.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
result:
Obviously, such a query will fail. Result with
getResults()
:System.QueryException: Didn't understand relationship 'Who' in field path. (...)
The same happens if there is a
Who
relationship on the queried SObject, but we choose a different field, which is ignored:result:
This query won't throw an exception, which is even worse, since is silently skips the field we expected to be queried.
The text was updated successfully, but these errors were encountered: