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
安倍安倍 

クラスが消せない→Apexジョブが参照している

以下メッセージが表示され、クラスが削除できません。

このApex クラスは、Salesforce の他の場所で参照されています。それを削除してから、もう一度やり直してください。Apex ジョブ

以下のコードを実行してみましたが、効果ありませんでした。
System.purgeOldAsyncJobs(Date.today().addMonths(-12));


for ( AsyncApexJob aJob : [ Select id ,Status, ApexClass.Name from AsyncApexJob where Status!='Aborted'and Status!='Completed' LIMIT 1000] ){
    System.AbortJob(aJob.Id);
}

また、以下のページにあるコードも実行してみましたが、効果ありませんでした。

https://developer.salesforce.com/forums/?id=9060G000000UW6gQAG

不要なので消したいですが、消す方法はありませんでしょうか。
 
Taiki YoshikawaTaiki Yoshikawa
設定→スケジュール済みジョブのページでSchedule登録されていないでしょうか。そのクラス自体は登録されていなくてもジョブに登録されたクラスが参照されている場合はロックが掛かる可能性があります。