Feedback

  • Contents
 

Custom Scripter Attributes

Scripter can create custom attributes within a custom script.  These attributes can be references to the actual values in the call list or can be a newly created attribute declared in a meta tag within the pages loaded in Scripter.

For example, suppose that the call list has a column called EmployeeSalary that stores employee salary totals.  When the page is popped to the agent, you want to take the salary and calculate the raise based on the percentage stored in the column RaisePercentage.  The newly calculated salary is to be stored in a newly created attribute within the page, but not persisted to the database.  The example below demonstrates how this can be achieved.


Example

<html>

<head>     <title>New Salary Page</title> </head>
<meta name="IS_Attr_EmployeeSalary"> <meta name="IS_Attr_RaisePercentage"> <meta name="IS_Attr_NewSalary">
<script language="javascript">     function CalculateRaise() {         IS_Attr_NewSalary.value = ((IS_Attr_RaisePercentage.value / 100) * IS_Attr_EmployeeSalary.value) + IS_Attr_EmployeeSalary.value;         tagOriginalSalary.innerText = IS_Attr_EmployeeSalary.value;         tagRaisePerc.innerText = IS_Attr_RaisePercentage.value;         tagNewSalary.innerText = IS_Attr_NewSalary.value;     } </script>
<body>     <font size=5 color=FFFFFF style="bold">         <em id="tagOriginalSalary">[Original Salary]</em></font>     <font size=5 color=FFFFFF style="bold">         <em id="tagRaisePerc">[Raise Percentage]</em></font>     <font size=5 color=FFFFFF style="bold">         <em id="tagNewSalary">[New Salary]</em></font> </body>
</html>