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
sessusessu 

hi GoodMorning

Hi I have created a login page for contact, once the user logs in VF page need to get display with all the details related to contact. I have wrote a class and page for this as I login it goes to contact details page but the values of the field are not getting display. please help me VF Page Contact Details
* First Name* Last Name
Class Public class Contact1 { public Contact con{get;set;} public Contact1() { con= new Contact(); } List c= new List(); Public List getdetails () { c=[select id, FirstName, LastName, MobilePhone, Phone, Email, LeadSource, AccountId from Contact where Id=:apexpages.currentpage().getParameters().get('id') ]; return c; } Public PageReference save() { insert con; PageReference pp= new pageReference('https://c.ap1.visual.force.com/apex/contactdetails1'); pp.setRedirect(true); return null; } }
Navatar_DbSupNavatar_DbSup

Hi,

Try the below code snippet as reference:

 

Public class Contact1

{

 public Contact con{get;set;}

 public Contact1()

  {

      con= new Contact();

  }

  List<contact> c= new List<contact>();

  Public List<contact> getdetails ()

  {

     c=[select id, FirstName, LastName, MobilePhone, Phone, Email, LeadSource, AccountId from Contact where Id=:apexpages.currentpage().getParameters().get('id') ];

      return c;

  }

  Public PageReference save()

  {

   insert con;

   PageReference pp= new pageReference('https://c.ap1.visual.force.com/apex/contactdetails1'); pp.setRedirect(true); return null;

  }

}

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.