Newer Version Available
DescribeTabSetResult クラス
名前空間
使用方法
Schema.describeTabs メソッドは、標準およびカスタムアプリケーションを説明する Schema.DescribeTabSetResult オブジェクトのリストを返します。
Schema.DescribeTabSetResult クラスのメソッドは、対応するプロパティを使用してコールできます。get で始まる各メソッドでは、get プレフィックスと末尾の括弧 () を省略して対応するプロパティをコールできます。たとえば、tabSetResultObj.label は tabSetResultObj.getLabel() と同じです。同様に、is で始まる各メソッドでは、is プレフィックスと末尾の括弧 () を省略できます。たとえば、tabSetResultObj.isSelected は tabSetResultObj.selected と同じです。
例
この例では、Schema.describeTabs メソッドをコールして使用可能なすべてのアプリケーションの Describe Information を取得する方法を示します。この例は各 Describe Result で繰り返され、Sales アプリケーションに関するその他のメタデータ情報が取得されます。
1swfobject.registerObject("clippy.codeblock-0", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17// App we're interested to get more info about
18String appName = 'Sales';
19
20// Get tab set describes for each app
21List<Schema.DescribeTabSetResult> tabSetDesc = Schema.describeTabs();
22
23// Iterate through each tab set describe for each app and display the info
24for(Schema.DescribeTabSetResult tsr : tabSetDesc) {
25 // Get more information for the Sales app
26 if (tsr.getLabel() == appName) {
27 // Find out if the app is selected
28 if (tsr.isSelected()) {
29 System.debug('The ' + appName + ' app is selected. ');
30 }
31 // Get the app's Logo URL and namespace
32 String logo = tsr.getLogoUrl();
33 System.debug('Logo URL: ' + logo);
34 String ns = tsr.getNamespace();
35 if (ns == '') {
36 System.debug('The ' + appName + ' app has no namespace defined.');
37 }
38 else {
39 System.debug('Namespace: ' + ns);
40 }
41 // Get the number of tabs
42 System.debug('The ' + appName + ' app has ' + tsr.getTabs().size() + ' tabs.');
43 }
44}
45
46// Example debug statement output
47// DEBUG|The Sales app is selected.
48// DEBUG|Logo URL: https://na1.salesforce.com/img/seasonLogos/2014_winter_aloha.png
49// DEBUG|The Sales app has no namespace defined.
50// DEBUG|The Sales app has 14 tabs.DescribeTabSetResult メソッド
DescribeTabSetResult のメソッドは次のとおりです。すべてインスタンスメソッドです。
getLabel()
署名
public String getLabel()
戻り値
型: String
使用方法
表示ラベルは、Salesforce ユーザインターフェースでタブの名前が変更されると変わります。詳細は、Salesforce オンラインヘルプを参照してください。
getLogoUrl()
署名
public String getLogoUrl()
戻り値
型: String
getNamespace()
署名
public String getNamespace()
戻り値
型: String
使用方法
この名前空間プレフィックスは、管理パッケージを公開できるように有効化されている Developer Edition 組織の名前空間プレフィックスに対応しています。このメソッドは、タブのセットを含むカスタムアプリケーションに適用され、管理パッケージの一部としてインストールされます。
getTabs()
署名
public List<Schema.DescribeTabResult> getTabs()
戻り値
isSelected()
署名
public Boolean isSelected()
戻り値
型: Boolean