-1

How can I get the CronExpression (string) from a trigger?

I see the expression in the DB but I am not sure how to retrieve it via the provided API.

user3397856
  • 41
  • 1
  • 1
  • 10

1 Answers1

1

You can simply try to cast the ITrigger instance to an ICronTrigger and call the CronExpressionString property.

if(trigger is ICronTrigger cronTrigger)
{
    return cronTrigger.CronExpressionString;
}
Rabban
  • 2,451
  • 1
  • 19
  • 21