Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
onCustomConsoleComponentButtonClicked()
Registers a function to call when
a button is clicked on an application-level custom console component. This method is only available in API version 25.0 or
later.
Syntax
1sforce.console.onCustomConsoleComponentButtonClicked(eventHandler:Function)Arguments
| Name | Type | Description |
|---|---|---|
| callback | function | JavaScript method called when a button is clicked on a custom console component. |
Sample Code–Visualforce
1<apex:page>
2
3 <apex:includeScript value="/support/console/68.0/integration.js"/>
4 <script type="text/javascript">
5 var eventHandler = function (result) {
6 alert('The Custom Console Component button is clicked. The component ID is: ' + result.id +
7 ' and the component window is: ' + (result.windowHidden ? 'hidden' : 'visible'));
8 };
9
10 sforce.console.onCustomConsoleComponentButtonClicked(eventHandler);
11 </script>
12
13</apex:page>Event Handler Response
This method is asynchronous, so it returns its response in an object in a callback method. The response object contains the following field:
| Name | Type | Description |
|---|---|---|
| id | string | The ID of the custom console component which includes the page. |
| windowHidden | boolean | true if the custom console component window is hidden after the button is clicked; false if the custom console component window is visible after the button is clicked. |