Comments (7)
Hi, I think you could select Owner.Name
instead of Owner.FirstName
. Because OwnerId
is a polymorphic lookup, which can be a user Id or a group Id. So I guess you cannot select FirstName
in this case.
from query.apex.
Actually when I write like this , I am not getting any Issues.
List oCase=[select Id,CaseNumber,ReceivedDate__c,CreatedDate,Owner.FirstName,Owner.Lastname,Origin from Case];
So do we have to follow the Owner.Name only as per your suggestion?
from query.apex.
I see the issue you're facing. I just did an update to fix this issue. You may pull the latest code and try again.
from query.apex.
from query.apex.
Hi @aranwe
In the very early implementation, we enforced field-level security, by traversing all the fields selected, including the fields from the parent object. In order to traverse the fields in the parent object, we had to get the object type of the parent object. If the parent field is a polymorphic lookup, I just randomly chose one, assuming that we could only select the common fields of the polymorphic object types. But when this issue was raised, I realized that assumption wasn't always true (FirstName
is not a common field but it can be selected in native SOQL).
Since APEX version 48, we can use the WITH SECURITY_ENFORCED
to enforce security checks, instead of traversing all the fields. Therefore I just replaced all the security checking codes with the new WITH SECURITY_ENFORCED
keyword. You may find it in this commit f5b2b7c.
from query.apex.
from query.apex.
@HenryRLee
Things are looking good now.
Thanks for your support.
from query.apex.
Related Issues (20)
- Add the anti-join feature
- Support SOQL toLabel function
- Support DISTANCE function
- Allow user to config flexible field attributes when select all fields HOT 1
- Code coverage is not sufficient.
- Add more condition methods to SOSL QuerySearch HOT 7
- Test code fails when using scratch org with Enterprise edition
- Cross Join HOT 1
- Limit Method HOT 1
- Missing Database.countQuery HOT 1
- Directly set Condition.conditionString HOT 12
- Add method to query by Ids only
- Support FORMAT() for Currency fields HOT 2
- orderBy does not support SObjectField parameter HOT 1
- Documentation: Make sure Org has QuickText enabled
- Using enforceGlobalSecurity and lookup() throws System.QueryException: expecting an equals sign, found ')' HOT 1
- Calling .debug() breaks countQuery() HOT 2
- Installing on org with Platform Encryption on Account.Name fails tests
- QueryTest Class uses WorkOrder object even though this Object is not present in every org by default. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from query.apex.