Name
|
Change Description
|
Version Number
|
Change
|
Calculate field's content can now be blank/deleted without causing issues.
|
Version 4.5.37
|
You should always give your calculate fields a suitable name and description to help others understand what you have used them for. The calculate Field Advanced Properties button takes you to the Calculation builder as shown below.
Calculation Builder
Click and type to add JavaScript and CallScripter helper functions to the window. Calculations are run every time a page is loaded, and every time an agent moves from field to field.
|
Field List
Lists fields from the current script. Click a field name to add it to the Calculation Builder.
|
Variable List
Shows a list of system and script variables. Click a variable name to add to the Calculation Builder.
|
Show Quick Code
Quick Code helps you build calculations from functions, fields and variables without having to type them in. Start typing the first few characters of a function, field or variable and a list will appear. Hover over any item in the list to view a description prior to selecting. In the example below, the disableFields Helper Function is shown.
|
Wrap Code
Wrap the code in the window if required.
|
Changing a CS Field that a Calculate references
If a CallScripter field referenced in a Calculate field is removed and re-added to the Script or it is renamed then the Calculate field will need to be manually updated to ensure it stays linked to the field. This is as CallScripter does certain back end actions when you save a Calculate field.
The simplest way to achieve this is to carry out the below steps:
-
Open the Calculate Field in the Script Editor
-
Identify each reference to the changed CS field and remove the square brackets from around it. Example below with a CS field called "aField":
[aField] = "value";
becomes
aField = "value";
-
Save the calculate. This clears out any old links on the backend of CallScripter.
-
Open the Calculate Field again.
-
Add in the square brackets around the CS field that you previously removed them from. If the CS Field name has changed this is also the time to update it. Example below with a CS field called "aField":
aField = "value";
becomes
[aField] = "value";
Debugging Calculate Fields
CallScripter Calculate fields run JavaScript in the industry standard manner with the exception of CS field names being substituted for the dynamic variable name.
This means that any JS errors can be debugged in the standard manner within Internet Explorer:
-
Enable all JS errors to be alerted and to not suppress any warnings under Internet Explorer options.
-
Start the Internet Explorer Developer Tools and refresh the CallScripter page. The IE Developer Tools will display the JS code that is being executed and identify the error it has hit.