You need to sign in to do that
Don't have an account?
Deepa Sekar
How to access URL parameters(passed via custom list button to VF page and then to component) in controller's init method
How to access URL parameters(passed via custom list button to VF page and then to component) in controller's init method
I've a custom list button with parameters a,b,c. On clicking, the control moves to a VF page and from there to a component.
I'm able to see a,b,c in my component only after init method is parsed but I want to use those values in INIT method and further pass those parameters to APEX method.
Custom list button URL:
https://help123.visualforce.com/apex/VFPageName?PARAM1={!Obj.field1}&PARAM2={!Obj.field2}&PARAM3={!Obj.field3}&PARAM4={!Obj.Id}&PARAM4={!Obj.Name}&hardcoded1=value1&hardcoded2=value2&hardcoded3=value3 value4 value5 value6
VFPageName:
<apex:page >
<apex:includeLightning />
<script>
$Lightning.use("c:Lightning_app", function() {
$Lightning.createComponent("c:customComponent",
{ //some stuff
},id,
function(component) {
component.set("v.PARAM1" , '{!$CurrentPage.parameters.PARAM1}');
component.set("v.PARAM2" , '{!$CurrentPage.parameters.PARAM2}'); and so on. . . .
I want to access the PARAM values directly in INIT method of my controller.
I've a custom list button with parameters a,b,c. On clicking, the control moves to a VF page and from there to a component.
I'm able to see a,b,c in my component only after init method is parsed but I want to use those values in INIT method and further pass those parameters to APEX method.
Custom list button URL:
https://help123.visualforce.com/apex/VFPageName?PARAM1={!Obj.field1}&PARAM2={!Obj.field2}&PARAM3={!Obj.field3}&PARAM4={!Obj.Id}&PARAM4={!Obj.Name}&hardcoded1=value1&hardcoded2=value2&hardcoded3=value3 value4 value5 value6
VFPageName:
<apex:page >
<apex:includeLightning />
<script>
$Lightning.use("c:Lightning_app", function() {
$Lightning.createComponent("c:customComponent",
{ //some stuff
},id,
function(component) {
component.set("v.PARAM1" , '{!$CurrentPage.parameters.PARAM1}');
component.set("v.PARAM2" , '{!$CurrentPage.parameters.PARAM2}'); and so on. . . .
I want to access the PARAM values directly in INIT method of my controller.
Recommend reviewing
https://salesforce.stackexchange.com/questions/289264/get-selected-records-from-lightning-list-view-custom-button-url-addressable
https://salesforce.stackexchange.com/questions/165650/getting-the-url-parameter-into-lightning-component-using-the-paramname-exp
If this information helps, please mark the answer as best. Thank you