- Salesforce - Navigating Setup
- Salesforce - Service Cloud
- Salesforce - Sales Cloud
- Salesforce - Environment
- Salesforce - Architecture
- Salesforce - Overview
- Salesforce - Home
Salesforce Objects
- Salesforce - Schema Builder
- Salesforce - Lookup Relationship
- Salesforce - Master Detail
- Salesforce - Custom Objects
- Salesforce - Standard Objects
Data Security
- Salesforce - Define Sharing Rules
- Salesforce - Create a Role Hierarchy
- Salesforce - Control Access Records
- Salesforce - Control Access Fields
- Salesforce - Control Access Objects
- Salesforce - Control Access Org
Process Builder
- Salesforce - Using Formula Fields
- Salesforce - Dashboards
- Salesforce - Reports
- Salesforce - Exporting Data
- Salesforce - Importing Data
- Automate Business Processes
Visualforce
- Salesforce - Static Resources
- Salesforce - List Controllers
- Salesforce - Using Forms
- Salesforce - Records, Fields & Tables
- Salesforce - Standard Controllers
- Salesforce - Variables & Formulas
- Salesforce - Visualforce Pages
Salesforce Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Salesforce - Records, Fields and Tables
We have already seen how to get the values of a record using the standard controller. But we can also display the field values in a more formatted way by using additional controllers.
In this chapter, we will see how to display the fields of an object and the data of a details table in a Master-detail relation.
Display Fields
When we want to display the fields of a record in a formatted manner with column headers, rather than just the labels and values, we can use the OutputField option. The code given below shows the apex program to display the filled data from Contact. As you can see, we do not need the labels to be in place to indicate the field values.
To preview the result of the above code, we use the ID of the record as described in the previous chapter. The result shows the following output showing the field values of the records along with column headers.
Display Tables
We can display all the records of a details table by taking a value from a master table. For example, we can display all the contacts associated with an account. In such case, we use the iteration component which in our case is the contacts table pnked to account. Below is the code to display all the contacts associated with the Account table.
On previewing the output form the above code, we get the following result.
Advertisements