I am trying to add new lightning action on one of my custom object. This action needs to go to VisualForce Page. But none of my VF pages are displayed in the drop-down.

Sample VF page:

<apex:page controller="PersonListController"  sidebar="false" showHeader="false">
    <apex:stylesheet value="{!URLFOR($Resource.bootstrap334, '/css/bootstrap.css')}"  />  

    <apex:pageBlock >
        <div style="margin-left:20px">

see attached screenshot....

enter image description here

> enter image description here

  • 1
    Can you share code snippet for the visualforce ? – Mohith Shrivastava Mar 5 '17 at 1:33

You can't add a Visualforce page to an object unless you use a standard controller. You'll need to change your page as follows:

<apex:page standardController="Event" extensions="PersonListController" ...

Also, you need to change your controller to have a standard extensions constructor:

public class PersonListController {
    public PersonListController(ApexPages.StandardController controller) {
|improve this answer|||||
  • Nice. Completely forgot about the controller part – Eric Mar 5 '17 at 1:47
  • It worked great, but now into another hole. Why it opens into new "Browser Tab" ? is there anyway set navigation rule? see the updated image. – dev.sforce Mar 5 '17 at 2:01
  • @dev.sforce Not sure. It didn't behave like that previously, but it might be an attempt to make Visualforce more stable in Lightning. I'll have to research it. – sfdcfox Mar 5 '17 at 3:08
  • @sfdcfox can you please join this room chat.stackexchange.com/rooms/54857/… I have a query – SFDC Mar 6 '17 at 5:58

You need to use a StandardController for the Visualforce page to have it appear in the list

If you were creating an action for the account your page would need to start like:

<apex:page standardController="Account">

Looks like in your case it would be Event

|improve this answer|||||

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.