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
KruviKruvi 

Aborting a scheduled job

Hi

 

I have a case where I would like to abort a scheduled APEX job.

Aborting should be performed from by a non admin user.

 

I'm getting an error saying "Insufficient Privileges" but I cannot find where to I assign the right privileges for this operation to succeed.

 

Any ideas?

 

Many thanks

 

 

Starz26Starz26

I believe they have to have the "Customize Application" permission

KruviKruvi

The abort action is done programaticaly in APEX.

Would enabling the "Customize Application" allow it as well or only through the UI?

 

Thanks

 


Starz26Starz26

So your users is running some apex class that aborts the job?

 

it should allow it after setting permission.

 

There are some consequences to this though as they will be able to do a lot of things you may not want them to.

 

 

KruviKruvi

Right - the application logic is in an APEX class and the user is an API user.

The class is running as a result of some REST request.

 

Problem is that I still cannot find the right permission to set for this to work.

 

I tries the permission you suggested earlier but it is not it.

 

Any suggestions?

Juan SpagnoliJuan Spagnoli

You can remove the "with sharing" from the class that is doing the AbortJob() 

 

Regards.