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 アイコンのセットがあります。「ConnectApi.Motif クラス」.を参照してください。
getMotifBatch(communityId, idOrPrefixList)
指定されたオブジェクトリストのモチーフを取得します。ConnectApi.Motif オブジェクトを含む BatchResult オブジェクトのリストを返します。読み込みできないユーザの結果に含まれるエラーを返します。
API バージョン
31.0
Chatter が必要かどうか
いいえ
署名
public static ConnectApi.BatchResult[] getMotifBatch(String communityId, List<String> idOrPrefixList)
パラメータ
例
1String communityId = null;
2
3// Create a list of records.
4ConnectApi.RecordSummaryList recordList = ConnectApi.RecordDetails.getRecentRecords(communityId, 'me');
5
6// Create a list of record IDs.
7List<String> recordIds = new List<String>();
8for (ConnectApi.ActorWithId record : recordList.records){
9 recordIds.add(record.id);
10}
11
12// Get info about the motifs of all records in the list.
13ConnectApi.BatchResult[] batchResults = ConnectApi.Records.getMotifBatch(communityId, recordIds);
14
15for (ConnectApi.BatchResult batchResult : batchResults) {
16 if (batchResult.isSuccess()) {
17 // Operation was successful.
18 // Print the color of each motif.
19 ConnectApi.Motif motif;
20 if(batchResult.getResult() instanceof ConnectApi.Motif) {
21 motif = (ConnectApi.Motif) batchResult.getResult();
22 }
23 System.debug('SUCCESS');
24 System.debug(motif.color);
25 }
26 else {
27 // Operation failed. Print errors.
28 System.debug('FAILURE');
29 System.debug(batchResult.getErrorMessage());
30 }
31}