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
John Zhao 15John Zhao 15 

Access to entity 'AIInsightValue' denied

Getting this error while running apex test classes after the Winter 2021 release on our sandbox. The apex test in question does not use any einstein functionalities.
Best Answer chosen by John Zhao 15
ShirishaShirisha (Salesforce Developers) 
Hi John,

Greetings!

This is an Einstein prediction insight value which is available if Einstein Analytics is enabled only.If your apex has not refer any thing related to Einstein then this should not throw the error.

So,I would suggest you to enable the permissions to fix the issue.

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_aiinsightvalue.htm

Also,it is started occurring after the release only then you can actually reach out to the Salesforce.com support to confirm,if there is bug created for this behaviour.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri

All Answers

John Zhao 15John Zhao 15
I'd also like to add, Einstein Analytics is not enabled in the org, so I'm do not even see the permission for AI Insight Value at all.
ShirishaShirisha (Salesforce Developers) 
Hi John,

Greetings!

This is an Einstein prediction insight value which is available if Einstein Analytics is enabled only.If your apex has not refer any thing related to Einstein then this should not throw the error.

So,I would suggest you to enable the permissions to fix the issue.

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_aiinsightvalue.htm

Also,it is started occurring after the release only then you can actually reach out to the Salesforce.com support to confirm,if there is bug created for this behaviour.

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
This was selected as the best answer
John Zhao 15John Zhao 15
Hi Shirisha, as I noted above, Einstein analytics is not enabled on our org. I've opened a ticket with salesforce support for further troubleshooting. Thanks for clarifying.
Patryk WoźniakPatryk Woźniak

Hi!

Have you resolved this problem?

Paritosh BhatiaParitosh Bhatia
I recieved the same error along with 'Internal Salesforce.com error' in the log. Resolved after removing checkpoints in dev console. Your issue maybe different but I doubt it has anything to do with 'AIInsightValue'.