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

Newer Version Available

This content describes an older version of this product. View Latest

Records クラス

レコード motif に関する情報にアクセスします。レコード motif は Salesforce UI でレコードタイプを区別するために使用される小さいアイコンです。

名前空間

ConnectApi

Records メソッド

Records のメソッドは次のとおりです。すべてのメソッドが静的です。

getMotif(communityId, idOrPrefix)

指定されたレコードの小、中、大の一連の motif アイコンの URL を含む Motif オブジェクトを返します。レコードのベース色を含めることもできます。

API バージョン

28.0

Chatter が必���かどうか

いいえ

署名

public static ConnectApi.Motif getMotif(String communityId, String idOrPrefix)

パラメータ

communityId
型: String
コミュニティの ID、internal、または null のいずれかを使用します。
idOrPrefix
型: String
ID またはキープレフィックス。

戻り値

型: ConnectApi.​Motif

使用方法

各 Salesforce レコードタイプには、独自の motif アイコンのセットがあります。「ConnectApi.​Motif クラス」.を参照してください。

getMotifBatch(communityId, idOrPrefixList)

指定されたオブジェクトリストのモチーフを取得します。ConnectApi.Motif オブジェクトを含む BatchResult オブジェクトのリストを返します。読み込みできないユーザの結果に含まれるエラーを返します。

API バージョン

31.0

Chatter が必要かどうか

いいえ

署名

public static ConnectApi.BatchResult[] getMotifBatch(String communityId, List<String> idOrPrefixList)

パラメータ

communityId
型: String
コミュニティの ID、internal、または null のいずれかを使用します。
idOrPrefixList
型: List<String>
オブジェクト ID またはプレフィックスのリスト。

戻り値

型: BatchResult[]

BatchResult.getResults() メソッドは ConnectApi.Motif オブジェクトを返します。

1String communityId = null;
2List<String> prefixIds = new List<String> { '001', '01Z', '069' };
3
4// Get info about the motifs of all records in the list.
5ConnectApi.BatchResult[] batchResults = ConnectApi.Records.getMotifBatch(communityId, prefixIds);
6    
7for (ConnectApi.BatchResult batchResult : batchResults) {
8    if (batchResult.isSuccess()) {
9        // Operation was successful. 
10        // Print the color of each motif.
11        ConnectApi.Motif motif;
12        if(batchResult.getResult() instanceof ConnectApi.Motif) {
13            motif = (ConnectApi.Motif) batchResult.getResult();
14        }
15        System.debug('SUCCESS');
16        System.debug(motif.color);
17    }
18    else {
19        // Operation failed. Print errors.
20        System.debug('FAILURE');
21        System.debug(batchResult.getErrorMessage());
22    }
23}