onFunctionsLoad() (tick_24Batch Wizard Only)

onFunctionsLoad()

This function is called after successfully loading a user functions file when a job is started.

This is the first event to be called for a Batch Wizard job.

Example 1:

function onFunctionsLoad() {
 // optionally change the start date & time here
 $_JOB.startdate=date("ddd',' MMM dd yyyy");
 $_JOB.starttime=time("hh':'mm':'ss tt");
}

Example 2:

New in v19/2019, the report filename can be changed in onFunctionsLoad(). The below example appends a day of the week to the report filename if it contains ".html" or ".xml", so "C:\reports\mywebsite.html" would become something like "C:\reports\mywebsite-Tue.html". If you run daily jobs then this would allow you to always keep the last 7 days of reports.

function onFunctionsLoad() {
 $day=date('ddd'); // day of week as a three-letter abbreviation
 $_JOB.report.filename=replaceStringNoCase($_JOB.report.filename,'.html','-'+$day+'.html');
 $_JOB.report.filename=replaceStringNoCase($_JOB.report.filename,'.xml','-'+$day+'.xml');
}