+ Start a Discussion
Marek CechMarek Cech 

openTab of workspaceAPI not working in iframe

Hi,

I've developed a custom Open CTI implementation for Lightning Service Console. I've been using Lightning components which are wrapped in a Visualforce page (to be able to create a Call Center and use click2dial - which is not possible without Visualforce as I found out). This results in an iframe which contains the Visualforce page. Unfortunately workspaceAPI stopped working when being in the iframe.
I've used workspaceAPI in the following way:
<lightning:workspaceAPI aura:id="workspace" />
Controller looks like this:
var workspaceAPI = component.find("workspace");
workspaceAPI.openTab({
    recordId:'0012F0000089wQuQAI',
	focus: true
}).then(function(response) {
	console.log('in then');
	workspaceAPI.focusTab({
	    tabId: response
	});
}).catch(function(error) {
	 console.log('in catch');
});
I've double checked that record ID exists. This code does not throw an error, 'in then' and 'in catch' is never logged to JS console and tab is not opened. Basically any functionality of workspaceAPI does not work in iframe.

Thanks for any help.
Marek
 
ashish sharma 188ashish sharma 188

Hi Marek, Were you able to solve this problem. I am facing the same error in Lightning Service console when opening a new Tab. 

Please let me know if you were able to find any solution for this.

Marek CechMarek Cech
Hi Ashish,

I've been given an advice that I should use screenPop() (https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_screenpop_lex.htm) function of Lightning Open CTI to be able to use click2dial and open tabs in Service Console. Unfortunatelly I've had a problem with this method as mentioned in another thread:
https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005Q16QAE