Please enable JavaScript
Apex Classes assignment to a Profile are stored in SetupEntityAccess entity/object. So, by filtering ParentId with the Profile's Permission Set Id and SetupEntityType = 'ApexClass', we can fetch the Apex Classes that are assigned to a Profile using Apex in Salesforce. Blog Post: https://www.infallibletechie.com/2023/03/how-to-get-apex-class-access-for-a-profile-using-apex-in-salesforce.html