I am developing a salesforce CTI integration that uses Version 37 of the salesforce JavaScript API.
When the user logs into the softPhone view I open another tab using the sforce.console.openPrimaryTab
function. I have had this functionality working for a long time, but this morning it is not opening the tab, and I haven't changed any code relating to it.
I call the openPrimary tab like this:
salesforceApi.console.openPrimaryTab(null, salesforceConfigurationManager.dashboardTabUrl, true, 'Dashboard', myCallback, 'myDashboardTabName');
My callback method is never hit.
I can see an error in the console:
aura_prod.js:878 Uncaught TypeError: Cannot read property 'indexOf' of undefined
throws at https://mysalesforceName.cs26.my.salesforce.com/jslibrary/1493309924000/sfdc/main.js:1290:54 TypeError: Cannot read property 'indexOf' of undefined
at Function.QueryString.getQueryStringIndex (main.js:1290)
at Function.QueryString.getURI (main.js:1290)
at Object.Sfdc.support.servicedesk.isNewEditUrl (ServiceDesk.js:formatted:4256)
at constructor.checkIsLimited (ServiceDesk.js:formatted:13626)
at new constructor (ServiceDesk.js:formatted:13488)
at Object.create (ext.js:formatted:9782)
at constructor.createComponent (ext.js:formatted:11583)
at constructor.lookupComponent (ext.js:formatted:11574)
at constructor.add (ext.js:formatted:11454)
at constructor.replaceTab (ServiceDesk.js:formatted:18607)
When I debug the code I can see that the error is occurring when it is checking if the URL of the tab I want to open is allowed (the checkIsLimited
function on serviceDesk.js).
The error is thrown because the contentUrl property of the object that is being passed into the checkIsLimited
function is undefined.
If I trace back to the beginning of the error stack (the replaceTab
function), I can see that in here the contentUrl property is also undefined.
If I set the contentUrl property by setting a break-point in the JavaScript and manually changing the value, the tab will open, so it looks like this is the cause of the issue, however I don't know what is causing contentUrl to be undefined as I have changed nothing in my code
- I have tried logging in with a different user to determine if there is some user setting that could be causing this, but the problem persists.
- I have tried calling the openPrimaryTab with only the required parameters and hard-coded values, the tab still doesn't open.
- I have reverted back to old versions of the code that are currently working in production, the tab still doesn't open.
Any ideas what else I can do. This was working perfectly on Friday and this morning it doesn't work
EDIT: I have just found that the salesforce version has been upgraded to Summer 2017. Should the API calls still not work?
EDIT:
Still waiting for salesforce to fix this, but I have noticed that any URL that has less than 2 characters after the domain seems to work. For example https://<domain>/something
will crash, as will https://<domain>/som
. However https://<domain>/so
will work as will https://<domain>/so/mething