標準ケースフィードページの複製
support:CaseFeed 属性
| 属性名 | 属性型 | 説明 | 必須項目 | API バージョン | アクセス |
|---|---|---|---|---|---|
| caseId | id | ケースフィードに表示するケースレコードの ID。 | はい | 26.0 | |
| id | String | ページの他のコンポーネントがコンポーネントを参照できるようにする識別子。 | 26.0 | グローバル | |
| rendered | Boolean | コンポーネントをページに表示するかどうかを指定する boolean 値。指定されていない場合、この値はデフォルトの true に設定されます。 | 26.0 | グローバル |
使用事例
National Foods は、全米のレストランおよび企業のカフェテリアを対象とする食品サービス会社です。National のサポート業務には、デスクトップコンピュータで主に作業を行うコールセンターエージェントと、モバイルデバイスで主に作業を行う出先エージェントの両方が携わります。この会社では、出先エージェントには使いやすい簡略化したケースフィードを提供し、コールセンターエージェントはケースフィードのフル機能にアクセスできるようにしたいと考えています。
National では、support:CaseFeed コンポーネントを使用して、デスクトップで作業するコールセンターエージェント向けに標準ケースフィードページを再作成し、モバイルデバイスで作業する出先エージェント向けにカスタムページを作成しました。
support:CaseFeed で作成した標準ケースフィードページ
コードサンプル
1swfobject.registerObject("clippy.codeblock-0", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<apex:page standardController="Case"
18 extensions="CasePageSelectorExtension" showHeader="true" sidebar="false">
19 <apex:dynamicComponent componentValue="{!casePage}"/>
20</apex:page>次のサンプルに、上記の Visualforce ページで使用されるコントローラ拡張を含む Apex クラスを示します。
1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public class CasePageSelectorExtension {
18 boolean isFieldAgent;
19 String caseId;
20
21 public CasePageSelectorExtension(ApexPages.StandardController controller) {
22 List<UserRole> roles = [SELECT Id FROM UserRole WHERE Name = 'FieldAgent'];
23 isFieldAgent = !roles.isEmpty() && UserInfo.getUserRoleId() == roles[0].Id;
24 caseId = controller.getRecord().id;
25 }
26
27 public Component.Apex.OutputPanel getCasePage() {
28 Component.Apex.OutputPanel panel = new Component.Apex.OutputPanel();
29 if (isFieldAgent) {
30 Component.Apex.Detail detail = new Component.Apex.Detail();
31 detail.subject = caseId;
32 panel.childComponents.add(detail);
33 } else {
34 Component.Support.CaseFeed caseFeed = new Component.Support.CaseFeed();
35 caseFeed.caseId = caseId;
36 panel.childComponents.add(caseFeed);
37 }
38 return panel;
39 }
40}