You need to sign in to do that
Don't have an account?
Chaminga Dissanayake 12
Passing parameter in Lightning Experience
I need to pass some URL/query parameters between Visualforce pages which are embedded in the lightning app.
Let's assume URL is -
https://cs1.lightning.force.com/one/one.app#/sObject/Opportunity/new?Unit__c=a0Zp0000002mja8ETA&isdtp=p1
So how can I access Unit__c in the controller?
The following code segment is not working with Lightning.
ApexPages.currentPage().getParameters().get('Unit__c')
Let's assume URL is -
https://cs1.lightning.force.com/one/one.app#/sObject/Opportunity/new?Unit__c=a0Zp0000002mja8ETA&isdtp=p1
So how can I access Unit__c in the controller?
The following code segment is not working with Lightning.
ApexPages.currentPage().getParameters().get('Unit__c')
Custom lightning app will be needed because attribute is required to get URL/query parameter. Unfortunately, we cannot add attributes to standard app/component in lightning app builder. You can receive url parameter by <aura:attribute> and pass it in iFrame VF page by client-side controller.
Below articles are also useful!
https://developer.salesforce.com/blogs/developer-relations/2017/01/lightning-visualforce-communication.html
http://salesforce.stackexchange.com/questions/106543/lightning-app-getting-url-parameter
For those who are still looking for a way to do this. I have a salesforce Experience site that has a VisualForce page on it. The VisualForce page is dependent on URL parameters. This is how I retrieved the URL parameter for the site.