screenPop() for Salesforce Classic

Usage 

Pops to a target URL, which must be relative.

Syntax 

1sforce.interaction.screenPop(url:string, force:boolean, (optional) callback:function)

Arguments 

NameTypeDescription
urlstringA relative URL, which specifies the location of the screen pop.
forcebooleanSet value to true to force a screen pop, false otherwise. This argument is only available in API version 28.0 and later.
callbackfunctionJavaScript method executed when the API method call is completed.

Sample Code–JavaScript 

1<html>
2<head>
3   <script type="text/javascript" src="http://domain:port/support/api/28.0/interaction.js"></script>
4   <script type="text/javascript">
5       var callback = function (response) {
6           if (response.result) {
7              alert('Screen pop was set successfully.');
8           }
9           else {
10              alert('Screen pop failed.' + result.error);
11           }
12        };
13       function screenPop() {
14                //Invokes API method
15                sforce.interaction.screenPop('/001x0000003DGQR', true, callback);
16        }
17</script>
18</head>
19<body>
20       <!-- Note that '001x0000003DGQR' is an example of an object Id to screen pop. -->
21       <button onclick="screenPop();">screen pop to entity Id</button>
22</body>
23</html>

Response 

NameTypeDescription
resultbooleantrue if the screen pop was successful, false if the screen pop wasn’t successful.
errorstringIf the API call was successful, this variable is undefined. If the API call failed, this variable returns an error message.