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 アプリケーションに関するその他のメタデータ情報が取得されます。
1// App we're interested to get more info about
2String appName = 'Sales';
3
4// Get tab set describes for each app
5List<Schema.DescribeTabSetResult> tabSetDesc = Schema.describeTabs();
6
7// Iterate through each tab set describe for each app and display the info
8for(Schema.DescribeTabSetResult tsr : tabSetDesc) {
9 // Get more information for the Sales app
10 if (tsr.getLabel() == appName) {
11 // Find out if the app is selected
12 if (tsr.isSelected()) {
13 System.debug('The ' + appName + ' app is selected. ');
14 }
15 // Get the app's Logo URL and namespace
16 String logo = tsr.getLogoUrl();
17 System.debug('Logo URL: ' + logo);
18 String ns = tsr.getNamespace();
19 if (ns == '') {
20 System.debug('The ' + appName + ' app has no namespace defined.');
21 }
22 else {
23 System.debug('Namespace: ' + ns);
24 }
25 // Get the number of tabs
26 System.debug('The ' + appName + ' app has ' + tsr.getTabs().size() + ' tabs.');
27 }
28}
29
30// Example debug statement output
31// DEBUG|The Sales app is selected.
32// DEBUG|Logo URL: https://https://yourInstance.salesforce.com/img/seasonLogos/2014_winter_aloha.png
33// DEBUG|The Sales app has no namespace defined.
34// 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