+ Start a Discussion

how to set a new button in visual force page?

dis is my code but i can't set new button 


<apex:pageBlockButtons >
<apex:commandButton action="{!naNew}" value="New"/>



public pagereference naNew(){
// book__c b = new book__c();
pagereference sp = new pagereference('/apex/newpage');
return sp;

Suresh RaghuramSuresh Raghuram

what do u mean by set for the button can u share more information


i want a new button for entering record in datamodel 

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

VF page


<apex:page standardController="Account" extensions="newvsold" action="{!pageredir}">

Apex class would be...
public class newvsold

public newvsold(ApexPages.StandardController controller)

public Pagereference pageredir()
Pagereference newpage = new Pagereference ('/001/e?retURL=/001/');
return newpage;