Write a syntax and structure of scheduler class?



Write a syntax and structure of scheduler class?..

Answer / Deepak Kumar Pathak

A Scheduler Class in Salesforce is defined by extending the `Schedulable` interface. Here's an example structure for a simple scheduler class that executes a method every hour:n```npublic class MyScheduler implements Schedulable {n public void execute(SchedulableContext SC) {n // Your custom logic goes heren }n}n```nThen, create a Cron expression to schedule the execution of your scheduler class through Setup -> Apex Classes & Objects -> Schedules.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

What are the different workflow actions available in workflows?

1 Answers   Cognizant,


How can I redirect the user to a page after processing is completed in the controller/extension?

1 Answers  


In trigger, lets say you have system.debug() statement after adderror() method. Will system.debug() be statement executed in trigger after adderror() method?

1 Answers  


What are custom labels in salesforce?

1 Answers  


Can we make a lightning component that shows up in both the mobile and the desktop user interfaces?

1 Answers  


Explain 'master-detail relationship' in salesforce ?

1 Answers  


Can a checkbox as controlling field?

1 Answers  


How to unit test code which has logic around the created date?

1 Answers  


Explain Test.setpage()?

1 Answers   Deloitte,


What is master detail relationship and look up relationship in salesforce?

1 Answers  


How long does Salesforce certification last?

1 Answers  


What is a Workflow Field Update?

1 Answers  


Categories