Finding Scheduler Last Run Time

0
Hi Team,We have one scheduler running for every 15 mins and updating the results of some tables.Now I want to display a dynamic message to the user, when the next run happens (ideally I want to find the difference of last run and next run).How to get these values programatically, Does we have any widgets/activities to fetch the sameRegardsAjay
asked
2 answers
2

Hi Ajay,


  1. Add a dataview to your page
  2. Set the source to microflow
  3. To find last run: Retrieve ScheduledEventInformation with XPath [Name='ModuleName.ScheduleEventName'], get first, sorted by EndTime DESC
  4. To find next run: Retrieve QueuedTask with XPath [ScheduledEventName='ModuleName.ScheduleEventName'], get first and use the StartAt attribute.
  5. Set the date time in a helper entity so your data view can display the value.


I recommend using a help entity for this rather than returning the system entity as it requires System.Administrator module role that you should not be giving out to your normal business user roles.


Hope this helps.



answered
1

Hi Ajay ,


You can use "ScheduledEventInformation" entity to retrieve specific schedule event information with the XPath [Name='ModuleName.ScheduleEventName'] .It should give the next start time.


Hope this helps!

answered