You need to sign in to do that
Don't have an account?
mukesh gupta
Sales console tab
I am using a lightning componet, whrn i click on a button then this coponent open. on this component i have a close button. when i click on this closed button page redirect to previous page, but tab not closed.
i am using below code for tab close
Can you please suggest.
i am using below code for tab close
closeFocusedTab : function(component, event, helper) { var workspaceAPI = component.find("workspace"); //alert(workspaceAPI); workspaceAPI.getFocusedTabInfo().then(function(response) { //alert('aaaa -- '+response); var focusedTabId = response.tabId; workspaceAPI.closeTab({tabId: focusedTabId}); }) .catch(function(error) { console.log(error); }); }
Can you please suggest.
You can use Navigation on the close button of the other cmp.
sforce.one.navigateToSObject(component.get("v.recordId"));
but tab is not closiing
Greetings to you!
You should use openTab() instead of navigateToSObject.
Please refer to the below links which might help you further.
https://salesforce.stackexchange.com/questions/208604/how-to-open-a-custom-lightning-component-tab-app-in-lightning-service-console
https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_opentab.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
this is a component, when i click on "Open" button then this lightning component open with "close" and "Save" btn. so i can't use 'workspaceAPI' when component open, Now i need to close the tab only
when i using your code i am not receive any 'response.tabId' in console log
Thanks