• Michael Fullmore
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,
Seeing a problem this week where the users of our managed package have started seeing an error related to permission access for the LastViewedDate on an object in our managed package.

when users open our editor page in their org, our apex control queries for the underlying customer object records which make up the model for the editor. the custom objects from our managed package. We perform a global apex describe. The LastViewedDate and other such hidden fields have started to be returned by the apex describe calls.

Schema.DescribeSObjectResult objectDescribe = globalSchema.get(objectName).getDescribe();
Map<String,Schema.SObjectField> objectFields = objectDescribe.fields.getMap();

But then when we perform isAccessible check, it returns false. The isAccessible check is required by Salesforce security review.

If you run the global describe from a dev console within the subscriber org, the LastViewedDate field is not returned.

We are seeing this on sandboxes CS105 and CS93, which are on Summer '20 Patch 13. Seems like a bug was introduced in Salesforce. These fields should not be returned by describe or if they are they should be accessible. On other sandboxes on Summer '20 we are not seeing this issue. Patch 12.6 does not seem to have this issue.

I know that adding tabs for these objects solves the issue, but the question is why this problem is showing up now.