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

describePrimaryCompactLayouts()

指定されたオブジェクト種別ごとに主コンパクトレイアウトに関するメタデータを取得します。最大で 100 個の情報が返されます。

構文

1DescribeCompactLayout[] primaryCompactLayouts = connection.describePrimaryCompactLayouts(string[] sObjectType)

使用方法

このコールを使用し、指定されたオブジェクト種別の主コンパクトレイアウトに関する情報を取得します。このコールは、指定された主コンパクトレイアウトに関するメタデータを返します。コンパクトレイアウトについての詳細は、Salesforce ヘルプを参照してください。

サンプルコード —Java

1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17public void testDescribePrimaryCompactLayoutsSample() {
18  try {
19    String[] objectsToDescribe = new String[] {"Account","Lead"};
20      DescribeCompactLayout[] primaryCompactLayouts = connection.describePrimaryCompactLayouts(objectsToDescribe);
21
22      for (int i = 0; i < primaryCompactLayouts.length; i++) {
23        DescribeCompactLayout cLayout = primaryCompactLayouts[i];
24        System.out.println(" There is a compact layout with name: " + cLayout.getName());
25
26        // Write the objectType
27        System.out.println(" This compact layout is the primary compact layout for: " + cLayout.getObjectType());
28
29        DescribeLayoutItem[] fieldItems = cLayout.getFieldItems();
30        System.out.println(" There are " + fieldItems.length + " fields in this compact layout.");
31
32        // Write field items
33        for (int j = 0; j < fieldItems.length; j++) {
34          System.out.println(j + " This compact layout has a field with name: " + fieldItems[j].getLabel());
35        }
36
37        DescribeLayoutItem[] imageItems = cLayout.getImageItems();
38        System.out.println(" There are " + imageItems.length + " image fields in this compact layout.");
39
40        // Write the image items
41        for (int j = 0; j < imageItems.length; j++) {
42          System.out.println(j + " This compact layout has an image field with name: " + imageItems[j].getLabel());
43        }
44
45        DescribeLayoutButton[] actions = cLayout.getActions();
46        System.out.println(" There are " + actions.length + " buttons in this compact layout.");
47
48        // Write the action buttons
49        for (int j = 0; j < actions.length; j++) {
50          System.out.println(j + " This compact layout has a button with name: " + actions[j].getLabel());
51        }
52      }
53
54    } catch (ConnectionException ce) {
55      ce.printStackTrace();
56  }
57}

引数

名前 説明
sObjectTypes string[] 1 つ以上のオブジェクトの配列。指定する値は、組織で有効なオブジェクトである必要があります。