No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Replicating a Standard Case Feed Page
support:CaseFeed Attributes
| Attribute Name | Attribute Type | Description | Required? | API Version | Access |
|---|---|---|---|---|---|
| caseId | id | ID of the case record to display in Case Feed. | Yes | 26.0 | |
| id | String | An identifier that allows the component to be referenced by other components in the page. | 26.0 | global | |
| rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 26.0 | global |
Use Case
National Foods is a food service company supplying restaurants and corporate cafeterias throughout the United States. National’s support operations includes both call center agents who work primarily on desktop computers and field agents who work mainly on mobile devices. The company wanted a simplified Case Feed page that would be easy for its field agents to use, and also wanted to give its call center agents access to the full Case Feed functionality.
National used the support:CaseFeed component to recreate the standard Case Feed page for its call center agents working on desktops, and created a custom page for its field agents working on mobile devices.
Code Sample
1swfobject.registerObject("clippy.codeblock-0", "9");<apex:page standardController="Case"
2 extensions="CasePageSelectorExtension" showHeader="true" sidebar="false">
3 <apex:dynamicComponent componentValue="{!casePage}"/>
4</apex:page>The following sample shows an Apex class containing a controller extension to be used with the Visualforce page above.
1swfobject.registerObject("clippy.codeblock-1", "9");public class CasePageSelectorExtension {
2 boolean isFieldAgent;
3 String caseId;
4
5 public CasePageSelectorExtension(ApexPages.StandardController controller) {
6 List<UserRole> roles = [SELECT Id FROM UserRole WHERE Name = 'FieldAgent'];
7 isFieldAgent = !roles.isEmpty() && UserInfo.getUserRoleId() == roles[0].Id;
8 caseId = controller.getRecord().id;
9 }
10
11 public Component.Apex.OutputPanel getCasePage() {
12 Component.Apex.OutputPanel panel = new Component.Apex.OutputPanel();
13 if (isFieldAgent) {
14 Component.Apex.Detail detail = new Component.Apex.Detail();
15 detail.subject = caseId;
16 panel.childComponents.add(detail);
17 } else {
18 Component.Support.CaseFeed caseFeed = new Component.Support.CaseFeed();
19 caseFeed.caseId = caseId;
20 panel.childComponents.add(caseFeed);
21 }
22 return panel;
23 }
24}