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

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
Experience Cloud サイトの ID、internal、または null
idOrPrefix
型: String
ID またはキープレフィックス。

戻り値

型: ConnectApi.​Motif

使用方法

各 Salesforce レコードタイプには、独自の motif アイコンのセットがあります。

getMotifBatch(communityId, idOrPrefixList)

オブジェクトリストの motif を取得します。

API バージョン

31.0

Chatter が必要かどうか

いいえ

署名

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

パラメータ

communityId
型: String
Experience Cloud サイトの ID、internal、または null
idOrPrefixList
型: List<String>
オブジェクト ID またはプレフィックスのリスト。

戻り値

型: ConnectApi.BatchResult[]

ConnectApi.BatchResult.getResult() メソッドは、ConnectApi.Motif オブジェクトと、読み込まれなかった 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}