What is the Scripting Manager?
Scripting in QuoteWerks can be used to extend functionality based on system events. The QuoteWerks Scripting Environment is where you can write powerful async JavaScript scripts to automate, customize, and extend your quoting workflows. The Scripting Manager is used to build and execute scripts in QuoteWerks and can be accessed via the navigation panel. Once in the Scripting Manager there are a few sections that you can use to build, test, and implement your scripts.
To access the Scripting Manager navigate to Setup -> Scripting Manager.
For extensive documentation on how scripting works, available event hooks, syntax and much more please navigate to the Scripting Manager and click on the
icon. This will open the QWW Scripting API Guide on the right hand side of the window.

Global Controls

Reload Everything - hitting this button will reload the Scripting Manager.
Show/Hide Scripting Logs - hitting this button will toggle the scripting logs, which if enabled will display at the bottom of the Scripting Manager
Show/Hide Documentation – hitting this button will toggle the Scripting Manager documentation. This displays scripting documentation which includes basic syntax, available event hooks, functions, calls, HTTP requests, sample event scripts, and field references. This documentation can be used to provide guidance while you are building your own scripts.
Save all changes - hitting this button will save any changes made across all event hooks.
Toggle Event Firing for All Scripts - hitting this toggle will turn event firing for all scripts on or off.
Event Triggers
On the left of the window is a full list of Event Hooks that can be enabled to trigger an event. To enable an Event Hook use the toggle button to turn it on and the save button to save a configured script.

Code Editor
The code editor can be used to build and test scripts. It will show at the top of the editor what event the script is assigned to, whether it has been saved, and whether it is enabled.

![]()
Code Editor Controls
This button will run the selected script.
This button will save the event script.
This button discards changes and reloads the script.
This button copies the script to the clipboard.
These buttons allow you to undo and redo changes made to the script.
This button will reload the event script from the server.
This button toggles the AI Assistant.
AI Assistant

The AI Assistant can be accessed by clicking on the brain
icon while in the editor or while editing a script tied to a specific event hook. The AI assistant can assist you in writing scripts based on a prompt. Simply type your prompt into the AI assistant and click AI Generate Script. The system will translate your prompt into the JavaScript code needed to accomplish the task and return it in the code editor. From here you can edit, save, or copy the script. You can toggle the AI assistant on or off at any time by clicking the brain
icon.
How to use the AI Assistant
The AI assistant is available in the code editor and when an Event is selected. To open the AI Assistant click on the Brain
icon. In the dropdown list next to ‘Need some inspiration?’ are sample prompts that can be used to generate specific scripts. If you would like to use the AI Assistant to write a script simply input your prompt (what you want the script to do) and hit ‘Submit.’ As AI processes the input, activity is logged in the Scripting Log which can be toggled on or off. The output will then be inserted into the code editor from which you can run, save, or edit the AI output.
Scripting Log
Clicking on
will open the scripting log at the bottom of the screen. This log will show the status of tasks within the scripting manager as well as when event hooks trigger a script to run.
![]()
Custom Buttons
With the Scripting Manager you can create custom buttons that will trigger a script to run independent of an Event Hook. You can create new custom button by clicking on Custom Buttons at the top left of the window.

You can create a new custom button by clicking on the plus
icon. The new button will be listed below. You can give the button a label, choose an icon for the button, and assign a tooltip for when someone hovers over the button.
![]()
You can also choose where you would like the button to be located. You can choose from Main Navigation (Left), Document Toolbar, Tools Menu, or Top Header Bar.

You can generate and test your script using the editor and toggle the button on or off on the left of the window.

Here is an example of a custom button added to the Top Header Bar:

Generating a Script: Example
1. Determine what you would like your script to do and whether you will be building your own script or using the AI Assistant to generate one for you.
2. Click on the Event Hook or Custom Button that you would like to trigger the script. In the example below we have chosen to have the script be triggered after contact selection.

3. Write your script using JavaScript and the code editor or have the AI Assistant generate one for you. The script will be listed for you to see what JavaScript drives it.

4. Once you have your script generated you can click the play
button to test your script. The script will run and will be logged in the scripting log.
5. Once you are happy with your script and are ready to have it go live, save it by clicking on the save
icon and enable it by using the toggle
button. The selected Event Hook will display in green.

6. Make sure that global scripting is enabled by using the toggle
button at the top of the window and click the save
button.

7. Now, when the Event Hook occurs or the custom button is selected, the configured script will run.