But you can't use a filter on Body. Body is a Long Text Area and filtering on Long Text Area fields is not supported.
So, you can use contains() String method. Try like this:
List<ApexClass> apexWithBody = new List<ApexClass>();
for(ApexClass ac : [SELECT id, Name, Body FROM ApexClass]) {
if(!ac.Body.contains('global class'))
apexWithBody.add(ac);
System.debug('apexWithBody -> ' + apexWithBody);
}
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Greetings to you!
You can query from ApexClass. You can find out all you need to know about the ApexClass object in the SOAP API Developer Guide.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_apexclass.htm
But you can't use a filter on Body. Body is a Long Text Area and filtering on Long Text Area fields is not supported.
So, you can use contains() String method. Try like this:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas