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.

Some of the variables in the $_JOB array can be set or changed here.

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:

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.

See also: date()

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');
}