Stonefield Query has a built-in scheduler that runs reports according to a user-defined schedule. It uses the Windows Scheduler to run these reports, so Stonefield Query's scheduler is really a simplified front-end for the Windows Scheduler. One of the tasks Stonefield Query's scheduler must perform is to create a command line which the Windows Scheduler uses to call Stonefield Query to run a particular report.

This script is called after the command line has been created, giving you the opportunity to modify the parameters passed to Stonefield Query as necessary.

A reference to the Stonefield Query Application object and the current command line for the scheduled task.

Return Value
The updated command line.

Here's an example that's related to the example discussed in the help topic for the Parameters collection. It adds a "dbpassword" parameter to the command line (in a real-world case, the password should be passed as encrypted text and decrypted in the OpenDataSource script rather than using plain text).

Visual FoxPro

lparameters toApplication as SQApplication, tcCommandLine
lcCommandLine = tcCommandLine + ' dbpassword=MyPassword'
return lcCommandLine


function Main(Application, CommandLine)
Main = CommandLine + " dbpassword=MyPassword"
end function


function Main(Application, CommandLine) {
var ReturnValue ;
ReturnValue = CommandLine + ' dbpassword=MyPassword' ;
return ReturnValue ;


Please note that the method in this script must be named Scheduler_GetCommandLine.

public static string Scheduler_GetCommandLine(SFQApplication sfqApplication, 
  string commandLine)
  return commandLine + " dbpassword=MyPassword";


Please note that the method in this script must be named Scheduler_GetCommandLine.

public shared function Scheduler_GetCommandLine(sfqApplication as SFQApplication,
  commandLine as string) as string
 Return commandLine + " dbpassword=MyPassword"
End Function

See also


© Stonefield Software Inc., 2018 • Updated: 06/06/16
Comment or report problem with topic