Records クラス
レコード motif に関する情報にアクセスします。レコード motif は Salesforce UI でレコードタイプを区別するために使用される小さいアイコンです。
名前空間
Records のメソッド
Records のメソッドは次のとおりです。すべてのメソッドが静的です。
getMotif(communityId, idOrPrefix)
レコードの小、中、大の一連の motif アイコンの URL を含む motif を取得します。レコードのベース色を含めることもできます。
API バージョン
28.0
Chatter が必要かどうか
いいえ
署名
public static ConnectApi.Motif getMotif(String communityId, String idOrPrefix)
パラメーター
戻り値
使用方法
各 Salesforce レコードタイプには、独自の motif アイコンのセットがあります。
getMotifBatch(communityId, idOrPrefixList)
API バージョン
31.0
Chatter が必要かどうか
いいえ
署名
public static ConnectApi.BatchResult[] getMotifBatch(String communityId, List<String> idOrPrefixList)
パラメーター
戻り値
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}