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
Ashish Sharma 207Ashish Sharma 207 

Trying to re-create a schedule job

Hello,

I want to re-create a schedule job and am unable to. This is the error that it keeps throwing me "You must select an Apex class that has a parameterless constructor."

Can someone tell me why it is throwing this or if there is a way I can retreive the schedule job?

Can I create  a change set for a schedule job/

Thank you.
 
Lokesh KumarLokesh Kumar

Hi Ashish,

Schedule Job is executing your logic written in the apex class so to schedule a job you must have a class with implementing the schedulable interface. So to find out the scheduled job you can go to Setup -> search for "Schedule Jobs" and then search by name -> click on scheduled job and look for the apex class used for it and check class has a schedulable interface or not.

And, if everything is good then to schedule a job.

Go to Apex class and click on schedule Apex Button choose your class which you want to schedule and select the time and save. 

Let me know if this help you !!

Thanks !


rajat Maheshwari 6rajat Maheshwari 6

Ashish,

According to your error, Now I am afraid that you are using parametric constructor of that class.

for ex - 

public class abcd implements schedulable
 {

   public abcd(Account acc)
    {}
}

but according to the error you have specified, It expects you to use parametricless Constructor.

ex - public abcd() {}

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com

Vivek WarrierVivek Warrier

I came looking for an answer to the same question, but I found that Rajat is right, and the resolution of this "issue" is, at the time of typing this answer, still an idea. Linking the same below: 

https://success.salesforce.com/ideaView?id=08730000000K15e

My problem was solved by digging a little deeper into the managed package that the class was a part of, and finding that it was being scheduled at the back-end from a button click.