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
Consider example:
Query.enforceGlobalSecurity(); Query q = new Query(Account.SObjectType) .selectFields(new String[]{'Name'}) .lookup('Id', new Query(Contact.SObjectType) .selectField(Contact.AccountId)); System.debug(q.toQueryString()); q.run();
Which creates query
SELECT name FROM Account WHERE (Id IN (SELECT accountid FROM Contact WITH SECURITY_ENFORCED)) WITH SECURITY_ENFORCED
The problem is with inner join query has WITH SECURITY_ENFORCED which fails SOQL parser.
As a workaround you can disable security check for lookup query:
Query q = new Query(Account.SObjectType) .selectFields(new String[]{'Name'}) .lookup('Id', new Query(Contact.SObjectType) .enforceSecurity(false) .selectField(Contact.AccountId));
The text was updated successfully, but these errors were encountered:
Nice catch.
I think we need to get rid of the WITH SECURITY_ENFORCED phrase, if there is one, inside the lookup method.
WITH SECURITY_ENFORCED
lookup
Sorry, something went wrong.
No branches or pull requests
Consider example:
Which creates query
The problem is with inner join query has WITH SECURITY_ENFORCED which fails SOQL parser.
As a workaround you can disable security check for lookup query:
The text was updated successfully, but these errors were encountered: