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
Varada Bhanage 5Varada Bhanage 5 

Unable to delete crone trigger INSUFFICIENT_ACCESS_OR_READONLY while deleting job from Cronetrigger

Hello guys,

We need to delete 2 Scheduled jobs from workbench through SOQL query as these jobs are not visible at from front end.
However when we try yo delete those jobs we are getting error 'INSUFFICIENT_ACCESS_OR_READONLY. Insufficient Access Rights On Object Id'
We are using below query in workbench: 

SELECT Id, CronJobDetail.Id, CronJobDetail.Name, CronJobDetail.JobType
FROM CronTrigger where CronJobDEtailID = '08aV0000006LlFTIA0' ORDER BY CreatedDate


PFB screenshot for error. What I need to to do to delete these jobs?
User-added image
SonamSonam (Salesforce Developers) 
Hi,

I checked the CronTrigger and CronJobDetail Object in Workbench and can see that for these objects, Deletable property is set to FALSE. 

You will have to use system.abortJob(Job ID) in order to abort this job: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_system.htm