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
BhaskararaoBhaskararao 

Custom Object

how can we retrive custom object records through Visualforce and modification through visualforce

Devendra@SFDCDevendra@SFDC

Hi,

 

There are various ways you can display custom object records on VF page.

 

Please refer below links to display custom object records

 

The below examples are given for standard objects. You can use them for custom objects by replacing standard controller with their API name.

 

For example:

Object - Student__c

standardController = "Student__c"

 

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

 

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

 

Hope this helps :)

 

Thanks,

Devendra

Suresh RaghuramSuresh Raghuram

Go To

Name- setup-develop- pages for a VF-page and apex class for the  Apex Class

 

in vf page

<apex:page controller="MyCtrl">

<apex:from>

<apex:pageblock>

Name<apex:InputText value="{!CustObjName__c.Name}"/>

Phone<apex:InputText value="{!CustObjName__c.Phone}"/>

<apex:pageblockbuttons>

<apex:commandButton value="Save" action={!Save}/>

<apex:commandButton value="Cancel" action={!Cancel}/>

</apex:pageblockbuttons>

</apex:pageblock>

</apex:form>

</apex:page>

Apex Classes

public class MyCtrl{

 

public PageReference save(){

CustObjName custObj = new CustObjName();

custObj.Name = CustObjName__c.Name;

custObj.Phone = CustObjName__c.Phone;

 

Insert custObj;

 

PageRefereence pageRef =  new PageRefereence('/custObj.Id');

pageref.setRedirect(true);

return pageRef;

}

}

If you have any questions feel free to post, I am happy to answer .