I created a custom visual force page that I use to overide the standard NEW action in the list view of one of my custom object.

I would also like to add a link to this custom VF page in the record view with an action button.

The problem is that the default behavior for an action button in a record page is to launch a modal on click. I would like to actually redirect to my VF page.

I read that a solution to this was to create a lightning component that on init would redirect to the visual force page and then link the component to the record page desired action.

I created a lightning component and an oninit action in the controller, but I have no clue how to redirect from the oninit controller action to my custom visualforce page. How can I figure out the url of my custom visual force page ? how do I make the redirect happen ?

doinit : function(component, event, helper) { // how to redirect to custom vf page here ? }


The Url of your VF page is {yourInstanceUrl}.com/apex/{yourVFPage}.

So your init function could be

doinit : function(component, event, helper) { 
    // redirect to custom vf page here
    window.location.href = 'http://myDomain.my.salesforce.com/apex/myCoolVFPage';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.