Visualforce page in a dashboard
- johnsontitus
- May 12, 2020
- 1 min read
<apex:page controller="retrieveCase" tabStyle="Case"> <apex:pageBlock> {!contactName}'s Cases <apex:pageBlockTable value="{!cases}" var="c"> <apex:column value="{!c.status}"/> <apex:column value="{!c.subject}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
public class retrieveCase { public String getContactName() { return 'Babara Levy'; } public List<Case> getCases() { return [SELECT status, subject FROM Case WHERE Contact.name = 'Babara Levy' AND status != 'Closed' limit 5]; } }
To create a dashboard that uses this Visualforce page:
View the dashboard and click Edit.
Click Add Component from the top of any column.
Choose a Visualforce Page as the component type.
Optionally, enter a header to display at the top of the dashboard component.
Optionally, enter a footer to display at the bottom of the dashboard component.
From the Visualforce Page drop-down list, select VFDash.
Click Save.

Comments