Newer Version Available

This content describes an older version of this product. View Latest

RecordActionHistory

Represents the lifecycle of the guided action as it goes through different states on an associated record. Available in API version 44.0 and later.

Access to the RecordActionHistory object is determined by a user’s access to the associated parent record.

Note

Supported Calls

describeSObjects(), query(), retrieve()

Special Access Rules

This object is always read-only.

Fields

Field Details
ActionDefinitionApiName
Type
string
Description
Required. The API name of the guided action associated with the record.
ActionDefinitionLabel
Type
string
Description
Required. The label of the guided action that took place.
ActionType
Type
picklist
Properties
Defaulted on create, Restricted picklist
Description
Required. The type of guided action, for example, Flow.
IsMandatory
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Optional. Specifies whether the action is mandatory. The default value is false.
LoggedTime
Type
dateTime
Properties
Filter, Sort
Description
Required. The timestamp when the state change occurred.
ParentRecordId
Type
reference
Properties
Filter, Sort
Description
Required. The parent record for the associated action.
Pinned
Type
picklist
Properties
Defaulted on create, Nillable, Restricted picklist
Description
Optional. Specifies whether the action is pinned to the top or bottom of the Guided Action List component. The default value is None.
  • Top
  • Bottom
  • None
RecordActionId
Type
string
Properties
Filter, Sort
Description
Required. The ID of the RecordAction.
State
Type
picklist
Properties
Defaulted on create, Restricted picklist
Description
Required. The state of the action. A state change triggers the logging of a history event.
  • Started
  • Paused
  • Resumed
  • Completed
UserId
Type
reference
Description
Required. The user that conducted the action.

Usage

The RecordActionHistory object represents the lifecycle of a guided action on a record as it goes through different states: started, resumed, paused, and completed.

The RecordActionHistory object is a big object. For this reason, when you use synchronous SOQL, SOAP, REST, Bulk, or Apex APIs to read this object, queries must follow a specific pattern or they fail. Queries must match one of these patterns and use fields in this precise order when more than one field is used.
  • ParentRecordId
  • ParentRecordId, LoggedTime (DESC)
  • ParentRecordId, LoggedTime (DESC), RecordActionId

For example, this SOQL query follows the ParentRecordId, LoggedTime (DESC) pattern.

1SELECT ActionDefinitionApiName, User, State FROM RecordActionHistory WHERE
2          ParentRecordId = {CaseId} ORDER BY ParentRecordId, LoggedTime DESC

Asynchronous SOQL queries do not need to follow a pattern, and can query any field.

Apex triggers cannot reference big object records. Use SOQL queries if you want to query RecordActionHistory records in Apex.

For more information about the Guided Action List component and how it works with RecordActions, see the Lightning Flow for Service Developer Guide. Learn more about big objects and how to query them in the Query Big Objects module on Trailhead.

Java Example

Here’s a Java example of how to query a RecordActionHistory object.
1public void queryHBPOs(String parentRecordId) {
2	  try {
3		  SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
4		  
5	      // query for the RecordActionHistory associated with ParentRecord      
6	      QueryResult queryResults = connection.query("SELECT ActionDefinitionApiName, LoggedTime, State " +
7	      		"FROM RecordActionHistory WHERE ParentRecordId = '" + parentRecordId + "' LIMIT 50");
8	      if (queryResults.getSize() > 0) {
9	        for (int i=0;i<queryResults.getRecords().length;i++) {
10	          // cast the SObject to a strongly-typed RecordActionHistory
11	          RecordActionHistory raa = (RecordActionHistory)queryResults.getRecords()[i];
12	          System.out.println("ActionDefinitionApiName: " + raa.getActionDefinitionApiName() + " - LoggedTime: "+ format.format(raa.getLoggedTime().getTime()) + " - State: " +
13	              raa.getState());
14	        }
15	      }
16	  } catch (Exception e) {
17	      e.printStackTrace();
18	  }
19  }