Keystone Auto-Task

From KeystoneIntranet
Jump to navigation Jump to search

Prerequisites

Keystone Auto-Task requires Keystone 3.0 or higher.

Configure Windows User Account

For security purposes, a separate Windows user account must be created for processing Keystone Auto-Tasks. This special user account must be properly configured to support the Windows Task Scheduler.

On the server or PC where the auto-task should run:

  1. Create a new Windows user account for user name "ksautotask". Assign a strong password to this account. This account should be a member of the "Users" group and ONLY this group.
  2. Open Control Panel->Administrative Tools->Local Security Policy.
  3. Under Security Settings->Local Policies->User Rights Assignment:
    • double-click "Log on as a batch job"
    • on the Local Security Settings tab, click "Add User or Group"
    • type "ksautotask" and click OK
    • click OK
    • double-click "Log on as a service"
    • on the Local Security Settings tab, click "Add User or Group"
    • type "ksautotask" and click OK
    • click OK


Configure Keystone Task

On the server or PC where the auto-task should run, create an auto-task control file for each auto-task. This can be created using Notepad and should have a '.ini' extension. The suggested folder to place these files is D:\CCGH\AUTOTASK (or C: if there is only one drive configured.)

Here is an example of an auto-task for "Prepare Remote Ticketing Data." This task will create the file for Company 002, Location 1.

[TASK]
COMPANYID=002
USERID=CCTASK
[LOCATIONS]
1=Y

Note that the "CCTASK" user id does not have to be created as a user in Keystone. This is purely for informational/logging purposes.

Configure Windows Task Scheduler

The final step is to configure the Keystone Auto-Task to run at a specific time. This is done using the Windows Task Scheduler.

On the server or PC where the auto-task should run:

  1. Open Control Panel->Administrative Tools->Task Scheduler.
  2. In the "Actions" box click "Create Task".
  3. On the General tab:
    • enter a name for the task (i.e. "Keystone Prepare Remote Ticketing Data")
    • under Security options, click "Change User or Group"
    • type "ksautotask" and click OK
    • click "Run whether user is logged on or not"
  4. On the Triggers Tab:
    • click NEW
    • configure the schedule appropriately for the task
    • check the "Stop task if it runs longer than" box and select "1 hour"
    • click OK
  5. On the Actions Tab:
    • click NEW
    • for Program/script enter the full path name of the Keystone option to run (including quotes): (i.e. "C:\Program Files (x86)\GivenHansco\Keystone\BIN\arutrmt.exe")
    • for Add arguments enter /t followed by the name of the auto-task control file (i.e. /t d:\ccgh\autotask\arutrmt.ini)
    • click OK
  6. Click OK.
  7. You will be asked to enter the password for user "ksautotask". Do so and click OK.

Sample Auto-Task Control Files

Prepare Remote Ticketing Data

Here is an example of an auto-task for "Prepare Remote Ticketing Data." This task will create the file for Company 001, Location 1.

[TASK]
COMPANYID=001
USERID=CCTASK
[LOCATIONS]
; list of locations to be processed in the form LOC_ID=Y or N
1=Y

Query Export Report

Here is an example of an auto-task for a Query Export report. This task will run a pre-defined Query Export report and generate a PDF output file.

[TASK]
COMPANYID=001
USERID=CCTASK
[QUERY]
; SESSION_NO and TRANS_NO of query in CCTQUERY table
SESSION_NO=6989
TRANS_NO=2
; ACTION can be 'REPORT' or 'EXPORT'
ACTION=REPORT
[REPORT]
DESTINATION=PDF
PDFFILENAME=d:\xfr\qxreport.pdf

NOTE: As of Keystone 3.0.3 only queries without parameters are supported for auto-task.

Query Export Export

Here is an example of an auto-task for a Query Export export. This task will run a pre-defined Query Export export and generate the export file specified in the query setup.

[TASK]
COMPANYID=001
USERID=CCTASK
[QUERY]
; SESSION_NO and TRANS_NO of query in CCTQUERY table
SESSION_NO=6989
TRANS_NO=2
; ACTION can be 'REPORT' or 'EXPORT'
ACTION=EXPORT

NOTE: As of Keystone 3.0.3 only queries without parameters are supported for auto-task.

A/R Customer List

Here is an example of an auto-task for the A/R Customer List. This task will run the report and generate a PDF output file.

[TASK]
COMPANYID=001
USERID=CCTASK
[REPORT]
DESTINATION=PDF
; Zip Code, Customer Id sequence
SEQUENCE=2
PDFFILENAME=d:\xfr\custlist.pdf
[SELECTION]
; only customers for Salesperson 'BA'
SALESPERSON=BA
[OPTIONS]
REPORT_TYPE=SUMMARY

Dispatch Order List

Here is an example of an auto-task for the Dispatch Order List to show plant 01 orders from today and beyond. This task will run the report and generate a PDF output file.

NOTE: The ability to specify [CURDATE] and [MAXDATE] in the SELECTION area requires Keystone 3.1.99.17 or higher.

[TASK]
COMPANYID=001
USERID=CCTASK
[REPORT]
DESTINATION=PDF
; Plant, Date, Customer Id, Order Id sequence
SEQUENCE=0
PDFFILENAME=d:\xfr\ordlist.pdf
[SELECTION]
; only orders for today and beyond
DELIVERY_DATE=[CURDATE],[MAXDATE]
PLANT_NO=01