function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Daniel Rudman 7Daniel Rudman 7 

LastViewedDate in Summer '20

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.
ShirishaShirisha (Salesforce Developers) 
Hi Daniel,

Greetings!

I would suggest you to reach out to the Salesforce.com support since you are experiencing this issue after the release.Also,I would request you to keep the details of the Orgs which are on previous release in handy to prove that the issue was occuring after release only.

Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Daniel Rudman 7Daniel Rudman 7
Thanks, sounds good. Case already opened.
Jon TreskoJon Tresko
@daniel
Did you get a resolution/Response?
Daniel Rudman 7Daniel Rudman 7
no we did not, support said it would be very hard to escalate without reproducing outside of the managed package, although the issue only occurs from the managed package.

anyways we easily patched and worked around it in our package, so was not worth the time going back and forth with support.
Michael FullmoreMichael Fullmore
@daniel
what was your workaround?
Daniel Rudman 7Daniel Rudman 7
Michael, we simply ignored the check for that field. So we do not process that field at all.