setTabUnsavedChanges()

Sets the unsaved changes icon (Unsaved changes on tab icon ) on subtabs to indicate unsaved data. This method is only available in API version 23.0 or later.

NameTypeDescription
unsavedbooleanIf true, the tab is marked as having unsaved changes.
callbackfunctionJavaScript method that’s called upon completion of the method.
subtabIdstringThe ID of the subtab that is marked as having unsaved changes. This argument is only available in API version 25.0 or later.

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

This method returns its response in an object in a callback method. The response object contains the following field:

NameTypeDescription
successbooleantrue if update was successful; false if update wasn’t successful.

This example is only set to run if the Visualforce page is inside an application-level custom component. For more information, see Methods for Application-Level Custom Console Components.

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

NameTypeDescription
successbooleantrue if returning the focused subtab ID was successful; false if if returning the focused subtab ID wasn’t successful.