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
sunny.kapoor1306sunny.kapoor1306 

Save button not working

I have created a 'save' button in vf page but it just refreshes the page without saving
In the apex class page refrence is created automatically
do i have to do something else too?

amritamrit

Hi,

 

May be its not returning anything Can you plz post the code.

 

 

Thanks

sunny.kapoor1306sunny.kapoor1306

hmm... u r right

actually save coding was automatically done in apex classes

 

here is the code:

 

public class clsdisplayleads
{

public PageReference Save() {
return null;
}

public list<Lead> getdetail()
{
list<Lead> led=[select name,Company,Salutation from lead where Status='Open - Not Contacted' or status='Working - Contacted'];
return led;
}
}

amritamrit

Hi,

 

How you are  calling in visualforce page.You will have to retrieve records using id

 

eg:

Id LeadId=ApexPages.CurrentPage().getParameters().get('id');

list<Lead> led=[select name,Company,Salutation from lead where id=:LeadId];

 

Try to refer this link

http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_pagereference.htm

 

sunny.kapoor1306sunny.kapoor1306

I have created a variable there for showing all the leads

aballardaballard

you need to add code to the save method to actually save something if that is what you want.  

 

Or use a standard controller, which has a save method instead of a custom controller where you ahve to do all the coding....