No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
setTabUnsavedChanges()
Usage
Sets the
unsaved changes icon (
) on subtabs
to indicate unsaved data. This method is only available in API version
23.0 or later.
Syntax
1sforce.console.setTabUnsavedChanges(unsaved:Boolean, callback:Function, (optional)subtabId:String)Arguments
Sample Code API Version 23.0 or Later–Visualforce
1swfobject.registerObject("clippy.codeblock-1", "9");<apex:page standardController="Case">
2 <A HREF="#" onClick="testSetTabUnsavedChanges();return false">
3 Click here to indicate this tab has unsaved changes</A>
4
5 <apex:includeScript value="/support/console/23.0/integration.js"/>
6 <script type="text/javascript">
7 function testSetTabUnsavedChanges() {
8 sforce.console.setTabUnsavedChanges(true, displayResult);
9 };
10 function displayResult(result) {
11 if (result.success) {
12 alert('Tab status has been successfully updated');
13 } else {
14 alert('Tab status couldn’t be updated');
15 }
16 }
17
18 </script>
19</apex:page>Response
This method returns its response in an object in a callback method. The response object contains the following field:
| Name | Type | Description |
|---|---|---|
| success | boolean | true if update was successful; false if update wasn't successful. |
Sample Code API Version 25.0 or Later–Visualforce
1swfobject.registerObject("clippy.codeblock-2", "9");<apex:page standardController="Case">
2 <A HREF="#" onClick="testSetTabUnsavedChanges();return false">
3 Click here to indicate this tab has unsaved changes</A>
4
5 <apex:includeScript value="/support/console/25.0/integration.js"/>
6 <script type="text/javascript">
7 function testSetTabUnsavedChanges() {
8 sforce.console.getFocusedSubtabId(setTabDirty);
9 };
10 function setTabDirty(result) {
11 sforce.console.setTabUnsavedChanges(true, displayResult, result.id);
12 };
13 function displayResult(result) {
14 if (result.success) {
15 alert('Tab status has been successfully updated');
16 } else {
17 alert('Tab status couldn’t be updated');
18 }
19 };
20 </script>
21</apex:page>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 |
|---|---|---|
| success | boolean | true if returning the focused subtab ID was successful; false if if returning the focused subtab ID wasn't successful. |