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
MattMet86MattMet86 

Call Flow from Schedulable Apex Calss

I am trying to call a flow from an Apex class that will eventually run on a monthly basis but i cannot get the syntax correct. Can anyone help me? 

I do not need to pass any values or params into the flow. Just need to call it. 

Here is my code:
global class scheduledMerge implements Schedulable {
   global void execute(SchedulableContext SC) {
    Flow.Interview.Reset_Badge_Count_Each_Month resetbadge = new Flow.Interview.Reset_Badge_Count_Each_Month;
    resetbadge.start();
   }
}

Here is my error: 
User-added image

Thanks for any help you can give!
 
Shashikant SharmaShashikant Sharma
Try this whth () before semicolon at end of line number 3 .
 
global class scheduledMerge implements Schedulable {
   global void execute(SchedulableContext SC) {
    Flow.Interview.Reset_Badge_Count_Each_Month resetbadge = new Flow.Interview.Reset_Badge_Count_Each_Month();
    resetbadge.start();
   }
}

 
MattMet86MattMet86
That didn't work. 

I got the following error message. 
Error: Compile Error: Constructor not defined: [Flow.Interview.Reset_Badge_Count_Each_Month].<Constructor>() at line 3 column 62
Lynn  M GrandeLynn M Grande
Were you able to get an answer? I am having same issue.
Francesca ColazzoFrancesca Colazzo
Same issue, any solution?