この文章は Salesforce 機械翻訳システムを使用して翻訳されました。詳細はこちらをご参照ください。
英語に切り替える

describeTheme()

現在のログインユーザが使用できるテーマの情報を返します。

構文

1DescribeThemeResult = connection.describeTheme(string sObjectType[]);

使用方法

describeTheme() を使用して、指定されたオブジェクト配列の現在のテーマ情報を取得します。テーマ情報は、特定のテーマに使用される、Salesforce 内のオブジェクトの色およびアイコンで構成されています。たとえば、Merchandise__c オブジェクトは通常の Salesforce アプリケーションテーマには「computer32」アイコンと、赤色の主タブ色を使用し、モバイルタッチスクリーンバージョンの Salesforce には別のセットの色とアイコンを使用できます。

オブジェクト配列ではなく、null を渡すと、describeTheme() は、テーマの色とアイコンを使用する組織内のすべてのオブジェクトのテーマ情報を返します。

組織のデータのテーマ情報を取得するには、条件を満たすアクセス権限でクライアントアプリケーションにログインする必要があります。詳細は、データアクセスに影響する要素を参照してください。

describeTheme() は、API バージョン 29.0 以降で使用できます。

サンプル

この Java のサンプルでは、describeTheme() をコールして取引先と取引先責任者のテーマ情報を取得した後、取得したテーマ情報を反復処理します。

1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public static void describeThemeExample() {
18    try {
19        // Get current themes
20        DescribeTheme themeResult = connection.describeTheme(
21                                        new String[] { "Account", "Contact" });
22        DescribeThemeItem[] themeItems = themeResult.getThemeItems();
23        for (int i = 0; i < themeItems.length; i++) {
24            DescribeThemeItem themeItem = themeItems[i];
25            System.out.println("Theme information for object " + themeItem.getName());
26            // Get color and icon info for each themeItem
27            DescribeColor colors[] = themeItem.getColors();
28            System.out.println("    Number of colors: " + colors.length);
29            int k;
30            for (k = 0; k < colors.length; k++) {
31                DescribeColor color = colors[k];
32                System.out.println("    For Color #" + k + ":");
33                System.out.println("      Web RGB Color: " + color.getColor());
34                System.out.println("      Context: " + color.getContext());
35                System.out.println("      Theme: " + color.getTheme());
36            }
37            DescribeIcon icons[] = themeItem.getIcons();
38            System.out.println("    Number of icons: " + icons.length);
39            for (k = 0; k < icons.length; k++) {
40                DescribeIcon icon = icons[k];
41                System.out.println("    For Icon #" + k + ":");
42                System.out.println("      ContentType: " + icon.getContentType());
43                System.out.println("      Height: " + icon.getHeight());
44                System.out.println("      Theme: " + icon.getTheme());
45                System.out.println("      URL: " + icon.getUrl());
46                System.out.println("      Width: " + icon.getWidth());
47            }
48        }
49    } catch (ConnectionException ce) {
50        ce.printStackTrace();
51    }
52}
53