Using the external macro tool

Command examples

You can run a macro at a scheduled time and date. Use the macro command tool which can be used external to , and can be initiated using a standard task scheduler, such as the Windows Scheduler. The macro tool is located at C:\Program Files\Infor\Sales and Operations Planning\tools\macro\ or a similar path, depending on the selected install location for .

Based on the installation settings, the default -sopUrl="<Preconfigured SCP Application URL>" command is created in the macrotool.bat file.

You must specify the parameters to initiate the macro command and the context in which the command is executed. Each parameter is preceded by '-' , apart from the macro name, which must be in quotes.

Parameter Description

"macro name"

The name of the macro to be run.

-authenticateAs=<userName:password>

Required. Indicates the user credentials to be validated.

-runAs=<username>

Optional. If specified, indicates the user duplicated (impersonate) to execute the macro. If not specified, indicates the user accessing . Use of the runAs parameter requires a security permission to execute a macro by a different user. The macro can be executed, only if the runAs user is authorized for the specified macro, or the parameter exists in a role authorized for the specified macro.

-cyclePeriod=<cycle name[:<cycle period name>]>

Cycle is required, cycle period is optional. If specified, indicates the cycle period during which the macro must be executed. If not specified, indicates the currently running cycle period for the specified cycle.

-scenario=<scenario name>

Optional. If specified, indicates the scenario in which the macro must be executed (assumes scenario-level macro command). If not specified, indicates the cycle period level macro.

The parameters can be specified in any order, using the parameter IDs to indicate each parameter value.

The command tool is used to execute a job . After, the job is validated, the logging of the process is managed by . A Return status of whether the job can be run is displayed on the command line and saved to a log file for reference, along with the job date and time. For example, if the authentication fails and the job is not run, the Failure status is displayed, along with the error message.

Note:  You can redirect the console output to a text/log file in the Append mode. To specify a different path, indicate the same in the log file: macrotool.bat >> macrotool.log or macrotool.bat >> C:\temp\macrotool.log.
"Update Master Data" -cyclePeriod="Normal" -authenticateAs="pmm/reese:aps01#"

Run the cycle period 'Update Master Data' macro against the 'Normal' cycle, using the most recent cycle period. The authenticated user is 'reese', who can run the macro.

"Email Demand Review" -cyclePeriod="Normal" -scenario="Demand-Baseline" -authenticateAs="pmm/reese:aps01#"

Run the'Email Demand Review' scenario macro against the 'Normal' cycle, using the most recent cycle period and 'Demand-Baseline' scenario. The authenticated user is 'reese', who can run the macro.

"Email Supply Review" -cyclePeriod="Normal:FY12 Jul" -scenario="Supply-Baseline" -runAs="pmm/mark:pa55word" -authenticateAs="pmm/reese:aps01#"

Run the 'Email Supply Review' scenario macro against the 'Normal' cycle, using the 'FY12 Jul' cycle period and the 'Supply-Baseline' scenario. The authenticated user is 'reese'; the macro is run as the user 'mark'.