getSoftphoneLayout() for Lightning Experience
Usage
Returns the softphone layout of the current user. This method is available in API version 38.0
or later.
Syntax
sforce.opencti.getSoftphoneLayout({
callback: function
});
Arguments
Name | Type | Description |
---|---|---|
callback | function | JavaScript method executed when the API method call is completed. |
Sample Code–HTML and JavaScript
<html>
<head>
<script type="text/javascript" src="https://domain:port/support/api/63.0/lightning/opencti_min.js"></script>
<script type="text/javascript">
var callback = function(response) {
if (response.success) {
alert(response.returnValue);
} else {
console.error(response.errors);
alert(
'Something went wrong. Please check error information in developer console.'
);
}
};
function getSoftphoneLayout() {
sforce.opencti.getSoftphoneLayout({
callback: callback
});
}
</script>
</head>
<body>
<button onclick="getSoftphoneLayout();">Get Softphone Layout</button>
</body>
</html>
Response
This method is asynchronous. The response is returned in an object passed to a callback method. The response object contains the following fields.
Name | Type | Description |
---|---|---|
success | boolean | If the API call is successful, the value true is returned and the softphone layout definition is returned in returnValue, false otherwise. |
returnValue | object | If the API call is successful, the softphone layout definition is returned. If the API
call fails, null is returned. The returned object
contains three elements that represent each of the call-types:
Each call-type contains three sub-sections:
The following is an example of a returnValue:
|
errors | array | If the API call was successful, this variable is null. If the API call failed, this variable returns an array of error messages. |