SandboxInfo

Represents a sandbox.

SandboxInfo enqueues a sandbox for creation or refresh. A create operation on SandboxInfo represents creation of a new sandbox, and an update represents refresh of an existing sandbox. For every creation or update, a SandboxProcess is automatically created and is used for monitoring the sandbox copy process.

Version 

Introduced in API version 35.0.

Supported SOAP API Calls 

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

Supported REST API Methods 

DELETE, GET, HEAD, PATCH, POST, Query

Fields 

ActivationUserGroupId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Introduced: API version 60.0

  • Description: A reference to the ID of the public group consisting of users who can access the sandbox. The user who created the sandbox is added to the group by default.

This field is a relationship field.

  • Relationship name: ActivationUserGroup
  • Relationship type: relationship
  • Refers to: Group

ApexClassId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Introduced: API version 36.0

  • Description: A reference to the ID of an Apex class that runs after each copy of the sandbox. Allows you to perform business logic on the sandbox to prepare it for use.

  • Relationship name: ApexClass

  • Relationship type: relationship

  • Refers to: ApexClass

AutoActivate 

  • Type: boolean

  • Required: No

  • Properties: Create, Defaulted on create, Filter, Group, Sort, Update

  • Description: If true, you can activate a sandbox refresh immediately.

  • Default value: false

CopyChatter 

  • Type: boolean

  • Required: No

  • Properties: Create, Defaulted on create, Filter, Group, Sort, Update

  • Description: If true, archived Chatter data is copied to the sandbox.

  • Default value: false

Description 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Nillable, Sort, Update

  • Description: A description of the sandbox, which helps you distinguish it from other sandboxes.

Features 

  • Type: textarea

  • Required: No

  • Properties: Create, Nillable, Update

  • Introduced: API version 59.0

  • Description: The add-on features to apply when creating or refreshing the sandbox.

Currently there’s one valid value:

  • ['SandboxStorage']: Increases the data storage available for Developer sandboxes from 200 MB to 400 MB and Developer Pro sandboxes from 1 GB to 2 GB. You can’t use this feature with Partial Copy or Full sandboxes.

HistoryDays 

  • Type: int

  • Required: No

  • Properties: Create, Defaulted on create, Filter, Group, Sort, Update

  • Description: Represents the number of days of object history to be copied in the sandbox.

Valid values:

  • -1, which means all available days
  • 0 (default)
  • 10
  • 20
  • 30
  • 60
  • 90
  • 120
  • 150
  • 180

LicenseType 

  • Type: picklist

  • Required: No

  • Properties: Create, Filter, Group, Restricted picklist, Sort, Update

  • Description: Represents the sandbox license type. Valid values:

  • Possible values:

    • FULL — Full

    • PARTIAL — Partial Copy

    • DEVELOPER_PRO — Developer Pro

    • DEVELOPER — Developer

    • COURTESY_FULL — Courtesy Full

    • ADVANCED_DEV — Lightning Developer Pro

    • ADVANCED_FULL — Lightning Full

    • FULL_PLUS — Scale

PostCopyConfig 

  • Type: textarea
  • Required: No
  • Properties: Create, Nillable, Update
  • Introduced: API version 68.0

SandboxName 

  • Type: string

  • Required: No

  • Properties: Create, Filter, Group, idLookup, Sort, Update

  • Description: Name of the sandbox.

SourceId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Introduced: API version 37.0

  • Description: A reference to the ID of a SandboxInfo that serves as the source org for a cloned sandbox.

  • Relationship name: Source

  • Relationship type: relationship

  • Refers to: SandboxInfo

TemplateId 

  • Type: reference

  • Required: No

  • Properties: Create, Filter, Group, Nillable, Sort, Update

  • Description: A reference to the PartitionLevelScheme that represents the sandbox template associated with this sandbox. A sandbox template lets you select which objects to copy in a sandbox.

To use the TemplateId field, you must have the ManageSandboxes user permission.

  • Relationship name: Template
  • Relationship type: relationship
  • Refers to: PartitionLevelScheme

Usage 

SandboxInfo and  SandboxProcess work together to manage the creation or refresh of a sandbox.

Creating a Sandbox 

To enqueue a new sandbox:

  • Create a SandboxInfo record.
  • To find the status of a sandbox after it is enqueued, query SandboxProcess for a given SandboxInfoId field to find the latest SandboxProcess record. The value of Completed in Status indicates that the creation process is finished.

Refreshing a Sandbox 

To refresh a sandbox:

  • To start a sandbox refresh, edit the SandboxInfo record.
  • To find the status of a sandbox after it is enqueued, find the latest SandboxProcess record by querying SandboxProcess for a given SandboxInfoId value. The value of Status indicates the current state of the process.
  • When the Status field value is Pending Activation, change the value of the RefreshAction field to either ACTIVATE or DISCARD.

Deleting a Sandbox 

To delete a sandbox, delete the SandboxInfo record that represents the sandbox. Deleting the SandboxInfo record deletes the sandbox and frees up a license.

Checking Sandbox Progress 

Each SandboxProcess record progresses through several stages represented by the StageType and StageNumber on the SandboxProcessStage record. The system updates progress details as the copy proceeds. For every stage, you can view specifics using the Status, StartTime, EndTime, and InfoLastUpdated fields.

If your sandbox status is suspended or stopped for more than 1 hour, contact Salesforce customer support.

While the system can’t provide a time-based estimate, you can track your place in the queue or how much work exists and has been completed.

  • During the In Queue stage, you can check your current place in the queue with the EstimatedTotalWork field.
  • During the Data Copy and Activation stages, you can check how much work exists and has been completed to estimate copy completion with the EstimatedTotalWork, ActualTotalWork, and CompletedWork fields.
  • If IsActualWorkFinal = true, then ActualTotalWork is a better representation of the total work required.
  • If IsActualWorkFinal = false, then EstimatedTotalWork is a better representation of the total work required.

Note