I have a custom lightning app.
How can I link to this app from a record's detail LEX page (e.g. Opportunity) and pass the Opp's ID to it?
The end-user is supposed to launch the app and do some additional Opportunity-stuff.
I've tried this so far:
-
Create a custom button (type = URL). Content:
{!URLFOR('/c/OppAwesomizer.app?opp=' + Opportunity.Id )}
The button/action shows up on the Opp's detail page (in LEX), but…
- It opens the custom App in an Iframe within the LEX UI.
- That does not work well if the browser does not like cross-domain iframe communications, because LEX itself works on: https://xyz.lightning.force.com/one/one.app…, but my custom button creates a URL for the iFrame like this: https://xyz.cs82.my.salesforce.com/servlet…
So e.g. my Chrome just displays a blank area and the console shows this message:
Uncaught SecurityError: Failed to read the 'sessionStorage' property
from 'Window': Access is denied for this document.
- Create a custom action to a LEX-enabled VF page that redirects to the app: Same behaviour as above…
Any help is greatly appreciated, I don't think SF has no way to achieve this but I have not been able to find anything on this…
Best Answer
This works in a URL button, although it sometime gives a warning "We'd like to open the Salesforce page https://[myDomain].lightning.force.com... in a new tab. Because of your browser settings, we need your permission first."