You need to sign in to do that
Don't have an account?
salesforce sfdx
Hi ohana ,Scheduled an apex class , but getting an error while execution please give your valuable comments
Created an apex class and added schedulable.
1.Need to run it every one hour
2.Need to run it in office time like 6am to 6pm.
3.Need to run it to work only for 1st 10 days of starting of every month.
so, i have added the below Code,
Getting the error of below:
System.StringException: Unexpected end of expression.
Can you please suggest your valuable suggestions.
Thanks
Thanks in advance.
1.Need to run it every one hour
2.Need to run it in office time like 6am to 6pm.
3.Need to run it to work only for 1st 10 days of starting of every month.
so, i have added the below Code,
scheduledMerge m = new scheduledMerge(); String sch = '0 6-18 1-10 * *'; String jobID = system.schedule('Merge Job', sch, m);
Getting the error of below:
System.StringException: Unexpected end of expression.
Can you please suggest your valuable suggestions.
Thanks
Thanks in advance.
Change in requirement that :
every day 6am to schedule it form 11th to 30th every month.
its run successfully and is added in the schedulejobs as well, but at morning 6am it was not executed, can you give your comments if i had done any thing wrong
All Answers
try with below code. Refer the below link
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm
If this helps, Please mark it as best answer.
Thanks!!
as per your code i tried but getting this Error..
Line: 3, Column: 1
System.StringException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.
Thanks
Can you please suggest some solutions for the above error.
Thanks,
try with below code is working. if this helps, Please mark it as best answer.
Thanks!!
Change in requirement that :
every day 6am to schedule it form 11th to 30th every month.
its run successfully and is added in the schedulejobs as well, but at morning 6am it was not executed, can you give your comments if i had done any thing wrong
the scheduler runs always in the time zone of the user who has started the scheduler.
Can you check your user time zone and it will based on your time zone.
Can you go to the scheduled jobs and check next schedule date & time now?
THanks!!
The company timezone is (GMT-04:00) Eastern Daylight Time (America/Toronto),it should fire as per this timezone
i had user changed the timezone with (GMT-04:00) Eastern Daylight Time (America/Toronto).
i deleted the scheduled job and sheduled a new one with the same code.please let me know if i need to add 2022 as an year or some thing need to add in the code
or
Need to make the apex class as future callout
or something else
Ankaiah