Overview
Automation Agent is a SalesPad service that creates configurable actions that can be run on a schedule. In this document you will learn how to set up and run Automation Agent, as well as the differences in functionality when Automation Agent is installed.
Note: Automation Agent is abbreviated as AA throughout this document.
Setting up Automation Agent
To set up AA you need:
- SQL credentials with access to the SQL master database
- SQL credentials to the server you will be using (these can be the same as the above credentials)
- A license code and email
- The Remote Library installed (The order of installation does not matter. This can be installed before or after AA.).
AA can be set up on its own database, which means it will have less of an impact on the production database. Still, testing should be done using a test database before using AA on a live database. When you first open AA, it will display a welcome screen and walk you through setup. Select Get Started unless you have already installed AA. Then, you can select Skip Set Up and continue to the Login screen.
On the next screen, you will select the SQL server you would like to connect to. This is the server in which Automation Agent will set up its tables. Connections do not have to be to the same server that SalesPad Desktop is installed on.
Next you will setup a database. This can be either a new database, as shown above, or you can connect to any database on the server(s) that you previously selected. AA will then prompt you set up an admin user account for AA. At the login screen, you can use the admin account that you just set up, or you can add or edit the connection, as shown on the following screenshot.
On this screen, you can set the connection name and select the server from the list of servers it can find, or if you know the name of your server, you can type it into the box labeled “Server.” The user account that you operate under has to have access to two databases; the SQL master database, and the company database set up in the previous step.
You will now be redirected to the licensing page. At this point, you will need the activation code provided by SalesPad and the email associated with that code. Once you have entered the activation code, you will be done with setup and AA will launch.
Running Automation Agent
When you open Automation Agent, your screen should look like the following screenshot. AA will not initially be running as a service; it will be an application.
You will notice when closing AA that clicking the X button will simply dock AA and not actually close the application. To close AA, you must open the Main Menu dropdown and select Exit.
Clicking Job Search will open a tab below the ribbon that will auto search all of your saved jobs.
Creating a Job in Automation Agent
Jobs in AA contain steps, schedules, and a run history. On the Job screen, you can edit a job's name, enable or disable it, edit the steps, edit its schedules, and view its history.
The Job Step Editor looks different for every Job Step Type (see below). Each job step requires a name and command type to run. The sequence, in general, can be left as 0. However, if one job needs to be run before another, the sequence can be set to any positive or negative value. The steps will run first in sequence order and then by Step ID. Job Steps can be individually toggled by enabling or disabling them. If the job is disabled, this field will not matter as no job steps will run on a disabled job.
When a Command Type is selected, the corresponding field labels appear. These fields are different for each Command Type, and if the command type is changed, all the data on the form is lost. Currently there are seven different Command Types in core: Forward Sales Batch, Forward Sales Doc ID, Invoice Sales Batch, Remove Sales Batch Holds, Run Script, Update Batch Entered, and Email. Every command type other than Email requires a SalesPad Remote URL. This can be found in SalesPad Desktop when you start the web service.
Generally, the Remote Library looks as follows when you start the service, and you will need the address found here for every job step. This address indicates the location of the host settings.
The Schedule Editor requires a name and a Frequency Type (1). The Frequency Type determines which fields are editable, making it easier to maintain the schedule. Most Frequency Types require the Daily Interval (2), Within the Day (3) and Date Limitations (4) fields to be filled. Please note that the Run Every field must have a Time Type (5) specified in order for it to work.
Installing Automation Agent as a Service
To install AA as a service, launch AA and click Job Processor.
Click the Install Service button.
Note: If AA is already installed as a service, this button will be labeled Reconfigure Service which will open an installation window with the option to select Automatic or Manual.
To reconfigure the AA service while it is already installed, click Reconfigure Service. This will take you back through the service installation process.
Uninstalling Automation Agent as a Service
If AA is installed, the Uninstall Service button to the right of the Install/Reconfigure Service button should be available.
To uninstall, click the Uninstall Service button. Once the service has been uninstalled, the screen will refresh. If an error occurs during this process, there will be a popup window explaining why it failed.
Starting/Stopping Automation Agent as a Service
Make sure that the service is installed before trying to start or stop the service. When the service is installed, the Start and Stop buttons will take longer to complete their operations. If anything goes wrong during starting or stopping, you will be notified with a small popup window.
Note: The grid that normally contains the schedules and what is currently going on with the service is empty when the service is installed. This is because the service is detached from the application when it is installed.
AA can also be started or stopped from the Services application in Windows. However, error reporting is less descriptive in Services than in the AA program. If anything does go wrong, check the Automation Agent Service Logs to see the error in more detail, as noted below.
Automation Agent Service Logs
AA normally logs to the Job History Table when it is installed as a service. The logs can be checked on a job’s History tab. However, AA also logs extra information about starting, stopping, and any errors that occur during the execution of a job in the Windows logs. If it happens to have an unhandled exception, it will be logged to the Windows Logs\Application, and will most likely be an error level log. The AA service will also create a log called Service.SalesPad.AutomationAgent.Log. This log will contain start and stop information, along with start and completion of job steps logged.