-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (47 loc) · 1.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<html>
<head>
<script type="text/javascript" src="./opencti_min.js"></script>
<script type="text/javascript">
var listener = function(payload) {
console.log('Clicked phone number*******');
console.log('Clicked phone number: ' + payload.number);
};
window.addEventListener('load', function() {
sforce.opencti.onClickToDial({listener: listener});
});
var callback = function(response) {
if (response.success) {
console.log('API method call executed successfully! returnValue:', response.returnValue);
} else {
console.error('Something went wrong! Errors:', response.errors);
}
};
function disableClickToDial() {
sforce.opencti.disableClickToDial({callback: callback});
}
function enableClickToDial() {
sforce.opencti.enableClickToDial({callback: callback});
}
function screenPop() {
sforce.opencti.screenPop({type: sforce.opencti.SCREENPOP_TYPE.OBJECTHOME, params: {scope:"Account"}, callback: callback });
}
function searchAndScreenPop() {
//Invokes API method
sforce.opencti.searchAndScreenPop({ searchParams : 'Acme',queryParams :
'Key1=value1&Key2=value2', callType : sforce.opencti.CALL_TYPE.INBOUND, deferred: false,
callback : callback });
}
</script>
</head>
<body>
Hello!!!
<br/>
<button onclick="screenPop();">screenPop</button>
<br/>
<button onclick="searchAndScreenPop();">searchAndScreenPop</button>
<br>
<button onclick="enableClickToDial();">enableClickToDial()</button>
<br>
<button onclick="disableClickToDial();">disableClickToDial()</button>
</body>
</html>