---
schema_version: "1"
id: 956abf0281acd905647670efe7353e6a5f9d02e4f829875aed4b42ff04b8b261
title: Records Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_ConnectAPI_Records_static_methods.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_Records_static_methods.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 51f2bbe28edf03381dc26596611a202e739b9d04c272255815a4abcc26cda431
description: Access information about record motifs, which are small icons used to distinguish record types in the Salesforce UI.These methods are for Records. All methods are static.Get a motif that contains the URLs for a set of small, medium, and large motif icons for a record. It can also contain a base color for the record.Get a motif for a list of objects.
---
# Records Class

Access information about record motifs, which are small icons used to distinguish record types in the Salesforce UI.

## Namespace

[ConnectApi](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_connect_api.htm "The ConnectApi namespace (also called Connect in Apex) provides classes for accessing the same data available in Connect REST API. Use Connect in Apex to create custom experiences in Salesforce.")

## Records Methods

These methods are for Records. All methods are static.

- **[getMotif(communityId, idOrPrefix)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_Records_static_methods.htm#apex_ConnectAPI_Records_getMotif)**  
    Get a motif that contains the URLs for a set of small, medium, and large motif icons for a record. It can also contain a base color for the record.
- **[getMotifBatch(communityId, idOrPrefixList)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_Records_static_methods.htm#apex_ConnectAPI_Records_getMotifBatch)**  
    Get a motif for a list of objects.

### getMotif(communityId, idOrPrefix)

Get a motif that contains the URLs for a set of small, medium, and large motif icons for a record. It can also contain a base color for the record.

#### API Version

28.0

#### Requires Chatter

No

#### Signature

public static ConnectApi.Motif getMotif(String communityId, String idOrPrefix)

#### Parameters

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

idOrPrefix

Type: String

An ID or key prefix.

#### Return Value

Type: [ConnectApi.​Motif](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_motif.htm "The motif properties contain URLs for small, medium, and large icons that indicate the Salesforce record type. Common record types are files, users, and groups, but all record types have a set of motif icons. Custom object records use their tab style icon. All icons are available to unauthenticated users so that, for example, you can display the motif icons in an email. The motif can also contain the record type’s base color.")

#### Usage

Each Salesforce record type has its own set of motif icons.

### getMotifBatch(communityId, idOrPrefixList)

Get a motif for a list of objects.

#### API Version

31.0

#### Requires Chatter

No

#### Signature

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

#### Parameters

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

idOrPrefixList

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<String>

A list of object IDs or prefixes.

#### Return Value

Type: [ConnectApi.BatchResult](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_batch_result.htm "The result of an operation returned by a batch method.")\[\]

The ConnectApi.BatchResult.getResult() method returns a ConnectApi.Motif object and errors for motifs that didn’t load.

#### Example

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());
    }
}