function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Athira VenugopalAthira Venugopal 

Unable to create a custom button with content as a visual force page , visual force page is not shown in the content

Here is my visual force page and apex controller:
StudentDisplay.vfp

<apex:page Controller="StudentDetails" >
    <apex:form >
        <apex:pageBlock title="New Student">
            <apex:pageBlockSection columns="1">
                <apex:inputField value="{!stud.Name}"/>
                <apex:inputField value="{!stud.Class__c}"/>
                <apex:inputField value="{!stud.DOB__c}"/>
                <apex:inputField value="{!stud.Physics__c}"/>
                 <apex:inputField value="{!stud.Chemistry__c}"/>
                 <apex:inputField value="{!stud.Maths__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!addNewStudent}" value="Save"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

StudentDetails .apxc
public class StudentDetails {
 public StudentData__c stud { get; set; }

    // Here initialize the book object
    public StudentDetails() {
        stud = new StudentData__c();
    }

    public PageReference addNewStudent() { 
       
        insert stud; 
        return null; 
    }
}
AnudeepAnudeep (Salesforce Developers) 
Can you change it to standardController and let me know if you are able to see the VF page?. Note that you can only refer those Visualforce pages in the custom button that use StandardController.

See this post for reference

Let me know if it helps

Thanks, 
Anudeep