Closed cropredyHelix closed 1 year ago
There were a bunch of changes to Describe at a platform level in the 2020 time frame that fixed some bugs with how schema data was cached on the platform side -- maybe this issue was caused by that?
But also, with the introduction of #419 , we're no longer recommending anyone uses the legacy homegrown CRUD/FLS enforcement and instead uses the native User Mode support that we added
This error
is thrown in method
getFieldPath()
Admin
profileAdmin
and does not haveView All Data
permissionwhen used in code as:
Relevant fflib_QueryFactory code is here:
Relevant selector is here:
for a Selector on FieldHistoryArchive, an OOTB object that comes with Shield Field Audit Trail that looks like this:
Notes:
fflib_QueryFactory
and instead just construct the SOQL as static or dynamic SOQL, when executed by the running, non-Admin user, the query finds the records as expected.Analysis
I think this has something to do with certain objects that are otherwise inaccessible to the running user per Describe but are available to the running user where CRUD is not enforced or otherwise not specifiable.
FieldHistoryArchive
appears to be one of these. So,fflib_QueryFactory
can't construct the query from the provided fieldnames. If I'm right, then perhaps the exception could provide more hints as to the range of possible causes:StrgeName
)