The following are methods for Records. All methods are static.
28.0
No
public static ConnectApi.Motif getMotif(String communityId, String idOrPrefix)
Type: ConnectApi.Motif
Each Salesforce record type has its own set of motif icons. See ConnectApi.Motif.
31.0
No
public static ConnectApi.BatchResult[] getMotifBatch(String communityId, List<String> idOrPrefixList)
Type: BatchResult[]
The BatchResult.getResults() method returns a ConnectApi.Motif object.
String communityId = null; List<String> prefixIds = new List<String> { '001', '01Z', '069' }; // Get info about the motifs of all records in the list. ConnectApi.BatchResult[] batchResults = ConnectApi.Records.getMotifBatch(communityId, prefixIds); for (ConnectApi.BatchResult batchResult : batchResults) { if (batchResult.isSuccess()) { // Operation was successful. // Print the color of each motif. ConnectApi.Motif motif; if(batchResult.getResult() instanceof ConnectApi.Motif) { motif = (ConnectApi.Motif) batchResult.getResult(); } System.debug('SUCCESS'); System.debug(motif.color); } else { // Operation failed. Print errors. System.debug('FAILURE'); System.debug(batchResult.getErrorMessage()); } }