Exercise #4 – Scripting and Dispatch Panel tips
Learn how scripting can streamline and automate dispatch business processes, saving businesses time and money. You’ll also explore a couple more features of the dispatch panel.
Note: This exercise builds on the previous three, so we recommend using the same Vehicle Tracker application and completing the exercises in order. You can see Exercise 1 here, Exercise 2 here, and Exercise 3 here.
Scripts can automate many dispatching processes, which means fewer chances for human error and large time savings. Today, we’ll create and test a timer script that dispatches all planned jobs. Businesses could use this to automate dispatching of jobs to their mobile workforce early each morning.
Be sure that you have the latest Dispatch 5 and Updatev5 versions. For this more advanced exercise, you will also need to check your permissions. Enable the following permissions for the selected testing application (SiteAdmin > Search and Manage, select the app, and choose Privileges and Features):
- • Events > _EditScriptExpression
- • Login > _WebServiceScriptLogin
- • All permissions in the ScriptApp folder
- • All permissions in the Plugins > Dispatch folder
Create an Event Script
Login to the same Vehicle Tracker application you used for Exercise 1-3 as an admin user.
Pre-work: Create a few jobs with worker = Exercise1Worker (your worker from our first exercise) and date = today. These should show with state = Planned. Our script will allow you to automatically dispatch them.
- Go to Development > App Builder.
- Click + New App.
- Name your app and choose the roles with access to it.
- In 2. Click Scripts, click + New Click Script.
- Name the click script, and select Timer in the Kind menu. For Next Execution, select an earlier time today (e.g. 4:00am with today’s date), and enter a schedule if you would like.
- Click Edit next to Script.
- Test the script by clicking > Run Script and then click Save.
- Click Save again on the Edit App page.
- • See job locations for each worker at glance.
- • Drill into a worker to see details about their routes and jobs for the day.
Job Locations at a GlanceClick on the pin icon on the right-hand side of a field worker row to see the location of all of their jobs. This works for jobs with worker Unassigned, and also for those currently assigned or dispatched to a worker.
Work / Job List DrilldownFor routes with lots of stops, or an abundance of jobs for a particular day, you may want to see many more jobs at a glance than you can via the Dispatch Panel rows.
- • Click the hamburger icon on the right-hand side of a field worker row to see a full job list for the field worker. You can also do this in the Unassigned jobs row.
- • Right-click the header row in the new window to customize the columns shown.
- • Change the column width by hovering your mouse on the column border until your curser shows arrows. Click when the arrows are showing and drag to resize a column.
- • Use the Resize to fit and the Force fit columns menu options to have the system auto-select column widths for you based on the window width.
- • Change the window size by using the drag feature in the bottom right corner of the window to resize.
- • Print a full job list with your chosen columns.
Congrats! You just learned how to optimize routes and report on Dispatch activity, which are both key for reducing costs. The next exercise is focused on advanced activity within Dispatch, such as scripting.
- Dispatch 5 technical blogs on the forum
- Dispatch 5 overview
- Exercise #1 - Dispatch job to smartphone app
- Exercise #2 - Complete a day of work in Dispatch
- Exercise #3 - Optimized routes and smart reporting
Discuss this blog post on the forum please