+ Start a Discussion
k sfdck sfdc 

Dynamically How to give my picklist values as CRon Expression like 0 0 12 ? 1/1 MON#1 *

public String monthDayNumber{get;set;}
public String monthDay{get; set;}

   public List<selectOption> getMonthDayOptions() {

   List<selectOption> option=new List<selectOption>();
      
    option.add(new selectOption('Sunday','Sunday'));
    option.add(new selectOption('Monday','Monday'));
    option.add(new selectOption('Tuesday','Tuesday'));
    option.add(new selectOption('Wednesday','Wednesday'));
    option.add(new selectOption('Thursday','Thursday'));
    option.add(new selectOption('Friday','Friday'));
    option.add(new SelectOption('Saturday','Saturday'));
 
        return option;
    }
public List<selectOption> getMonthDayNumberOptions() {
  
    List<selectOption> option=new List<selectOption>();
     option.add(new selectOption('1st','1st'));
     option.add(new selectOption('2nd','2nd'));
     option.add(new selectOption('3rd','3rd'));
     option.add(new selectOption('4th','4th'));
     option.add(new selectOption('Last','Last'));
 
        return option;
    }

how to add above selectoptions  values as CRON Expression Dynamically?
0 0 12 ? 1/1 MON#1 *
NK@BITNK@BIT
You can do like this..

List<CronTrigger> con = [select CronExpression from CronTrigger];

List<selectOption> option=new List<selectOption>();
for(CronTrigger c : con){
option.add(new selectOption(c.CronExpression,c.CronExpression));
}