---
schema_version: "1"
id: b9713551929184a7712ff3fe33131b2ab357be43cf9176a548fda6fc09c52cf3
title: MacroUsage
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_macrousage.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_macrousage.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0e94eb0a9c44499878c79604a1059e7316ab432d5e708d49717c3f76c09132ce
description: Represents macro usage on a record, including which macro was used, who used it, and how they used it. This object is available in API version 47.0 and later.
---
# MacroUsage

Represents macro usage on a record, including which macro was used, who used it, and how they used it. This object is available in API version 47.0 and later.

## Supported Calls

describeSObjects(), getDeleted(), getUpdated(), query(), retrieve()

delete() is supported in API version 55.0 and later.

## Special Access Rules

This object is always read-only. Only users with “Modify All Data” permission can delete MacroUsage records.

## Fields

| Field | Details |
| --- | --- |
| AppContext | 
Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

Context in which the macro was run. Possible values are:

- Aloha—Salesforce Classic
- Lightning—Lightning Experience
- Unknown





 |
| ConditionCount | 

Type

int

Properties

Filter, Group, Nillable, Sort

Description

Number of conditional instructions contained in the macro at execution.



 |
| ContextRecord | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

ID of the record on which the macro was run.



 |
| DurationInMs | 

Type

int

Properties

Filter, Group, Nillable, Sort

Description

The execution time, in milliseconds, for the macro.



 |
| ExecutedInstructionCount | 

Type

int

Properties

Filter, Group, Nillable, Sort

Description

The number of macro instructions that ran successfully. If the macro completed successfully, this value is the same as InstructionCount.



 |
| ExecutionEndTime | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The time at which macro execution completed.



 |
| ExecutionState | 

Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

The end state of macro execution. Possible values are

- SUCCESS
- FAILURE
- CANCELED





 |
| FailureReason | 

Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

If ExecutionState is failure, this field stores the reason for the failure. Possible values are:

- ACCESS
- GENERIC
- TIMEOUT
- UNSUPPORTED





 |
| FolderId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

ID of the folder containing the macro at the time it was used.



 |
| InstructionCount | 

Type

int

Properties

Filter, Group, Nillable, Sort

Description

The number of instructions in the macro at the start of execution.



 |
| IsFromBulk | 

Type

boolean

Properties

Defaulted on create, Filter, Group, Sort

Description

If true, the macro was run as a bulk macro. When a bulk macro is run on multiple records, usage is recorded per record.



 |
| MacroID | 

Type

reference

Properties

Filter, Group, Sort

Description

ID of the macro.



 |
| Name | 

Type

string

Properties

Filter, Group, idLookup, Sort

Description

Name of the macro.



 |
| OwnerId | 

Type

reference

Properties

Filter, Group, Sort

Description

ID of the group or user that owns the macro.



 |
| UserId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

ID of the user that ran the macro.



 |

## Associated Objects

This object has the following associated objects. Unless noted, they are available in the same API version as this object.

[MacroUsageOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_ownersharingrule.htm "StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. These objects represent a rule for sharing a standard object with users other than the owner.")

Sharing rules are available for the object.

[MacroUsageShare](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.")

Sharing is available for the object.