getFocusedSubtabObjectId()

Returns the object ID of the subtab on which the browser is focused. For example, a case ID or account ID. This method is only available in API version 24.0 or later.

NameTypeDescription
callbackfunctionJavaScript method that’s called upon completion of the method.

To see this example in action, click the custom link on a case. For more information, see Define Custom Buttons and Links in Salesforce Help.

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following fields:

NameTypeDescription
idstringThe object ID of the subtab on which the browser is focused. If no subtab is open, the ID is null.
successbooleantrue if returning the object ID of the focused subtab was successful; false if returning the object ID of the focused subtab wasn’t successful.