Newer Version Available
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;
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}