You need to sign in to do that
Don't have an account?
Dave The Rave
Reschedule Apex Job using Dev Console
All, I had to delete a scheduled apex job, as this was running under my name.
Now I need to reschudule the apex job to run every hour.
Apex Class is below, can I reschedule this in the Dev Console <Open Execute Anomymouse Window"? and how can I do that?
Now I need to reschudule the apex job to run every hour.
Apex Class is below, can I reschedule this in the Dev Console <Open Execute Anomymouse Window"? and how can I do that?
/** * Schedulable class to retrieve external User Stories on a scheduled basis. * * @author Ümit Can Uçkan * @version 1.0 * @since CCM Integrations 1.0 */ global class ScheduleUserStoryFetch implements Schedulable { copado__Project__c cpRecord; public ScheduleUserStoryFetch(Id pId){ cpRecord = [SELECT Id,Name, Copado_Integration_Setting__r.External_System__c, Copado_Integration_Setting__r.Named_Credential__c,JQL_Extended_Filter__c,Enable_Logs__c, Project_External_Id__c, Workspace_Id__c FROM copado__Project__c WHERE Id=:pId]; } global void execute(SchedulableContext sc) { Database.executeBatch(new ExecuteUserStoryUpsert(this.cpRecord),200); } }
Please try the below-updated code :
System.schedule('Hourly', '0 0 * * * ?', new ScheduleUserStoryFetch(pId ) ); //pId refers to id of any record od Copado_project__c object
I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.
Thanks and Regards,
Suraj
All Answers
Please use below code in your developer console
This will scheduled the job to run in every hour starting from 12 AM
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
This did not work, I got the following error in the dev console:
Please try the below-updated code :
System.schedule('Hourly', '0 0 * * * ?', new ScheduleUserStoryFetch(pId ) ); //pId refers to id of any record od Copado_project__c object
I hope you find the above solution helpful. If it does, please mark it as Best Answer to help others too.
Thanks and Regards,
Suraj
"Line: 1, Column: 69
Variable does not exist: pId"
Hey Dave,
As I have already written in the comment pID refers to record Id, which means you have to pass any record ID in it.
You can create a new record or use an existing record according to your code requirements.
Let me know if you need any assistance.
Hope it's working now. please mark it as Best Answer to help others too.
Thanks and Regards,
Suraj