---
schema_version: "1"
id: 32fca44ac8010b154e629bf931bc6cd454f6551f77e2db6c49beab615b8fe089
title: ActiveScratchOrg
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_activescratchorg.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_activescratchorg.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3b77cb8582c4743b35158762541af20643dbd3cad8f4b872d026fb20369b5aff
description: Represents an active scratch org. This object is available in API version 41.0 and later.
---
# ActiveScratchOrg

Represents an active scratch org. This object is available in API version 41.0 and later.

## Supported Calls

delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update()

## Fields

| Field Name | Details |
| --- | --- |
| Description | 
Type

textarea

Properties

Create, Nillable, Update

Description

A description of this scratch org.



 |
| Edition | 

Type

picklist

Properties

Filter, Group, Nillable, Restricted picklist, Sort

Description

The org edition of this scratch org. Possible values are Group, Developer, Enterprise, and Professional. This field is read only.



 |
| ExpirationDate | 

Type

date

Properties

Filter, Group, Nillable, Sort

Description

Date when the scratch org expires. This field is read only.



 |
| Features | 

Type

textarea

Properties

Nillable

Description

The features enabled in this scratch org, such as MultiCurrency. See the Salesforce DX Developer Guide for the full list of valid features. This field is read only.



 |
| HasSampleData | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort

Description

Specifies whether the scratch org contains sample data. If set to true, the sample data is similar to the data in a Salesforce free trial org.



 |
| LastLoginDate | 

Type

date

Properties

Filter, Group, Nillable, Sort

Description

The date of the last user login to the scratch org. This field is read only.



 |
| LastReferencedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last accessed this record indirectly, for example, through a list view or related record. This field is read only.



 |
| LastViewedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last viewed this record or list view. If this value is null, and LastReferenceDate isn’t null, the user accessed this record or list view indirectly. This field is read only.



 |
| Name | 

Type

string

Properties

Autonumber, Defaulted on create, Filter, Sort

Description

The auto-generated ID of this scratch org. This field is read only.



 |
| Namespace | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

The namespace associated with this scratch org. This field is read only.



 |
| OrgName | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

The name of the scratch org. This field is read only.



 |
| OwnerId | 

Type

reference

Properties

Defaulted on create, Filter, Group, Sort, Update

Description

The ID of the user who owns this scratch org. This field is read only.



 |
| ScratchOrg | 

Type

string

Properties

Filter, Group, Sort

Description

The org ID of the scratch org. This field is read only.



 |
| ScratchOrgInfoId | 

Type

reference

Properties

Filter, Group, Nillable, Sort, Update

Description

The id of the associated ScratchOrgInfo object. This field is read only.



 |
| SignupEmail | 

Type

email

Properties

Filter, Group, Nillable, Sort

Description

The email address of the Administration user. This field is read only.



 |
| SignupInstance | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

The Salesforce instance on which this scratch org resides. This field is read only.



 |
| SignupTrialDays | 

Type

int

Properties

Filter, Group, Nillable, Sort

Description

The number of days between the scratch org's creation and expiration. This field is read only.



 |
| SignupUsername | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

The username of the Administration user of the scratch org. This field is read only.



 |
| Snapshot | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

If this scratch org was created from a scratch org snapshot, then this field contains either the name or ID of the snapshot. Specifically, the name corresponds to the Name field of the snapshot’s record in the OrgSnapshot standard object; the ID corresponds to the record ID.

If this scratch org wasn’t created from a snapshot, this field is empty. This field is read only.

This field is available in API version 61.0 and later.



 |

## Usage

Salesforce automatically creates an instance of this object after a ScratchOrgInfo record moves to the Active state. The new ActiveScratchOrg gets many of its field values from the ScratchOrgInfo object with which it’s associated.

When you delete an ActiveScratchOrg record, its associated scratch org is deleted and its associated ScratchOrgInfo record is moved to the Deleted state.

## Associated Objects

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

[ActiveScratchOrgFeed](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.")

Feed tracking is available for the object.

[ActiveScratchOrgHistory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")

History is available for tracked fields of the object.

[ActiveScratchOrgShare](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.

#### See Also

- [ScratchOrgInfo](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_scratchorginfo.htm "Represents a scratch org and its audit log. Use this object to create a scratch org and keep a log of its creation and deletion. This object is available in API version 41.0 and later.")
- [NamespaceRegistry](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_namespaceregistry.htm "Represents a namespace that you can link to scratch orgs that were created from your org’s Dev Hub. You use the namespace when developing, packaging, and releasing an app. You can’t create this object with the API. Use the Link Namespace action in the Dev Hub graphical interface to insert a NamespaceRegistry record. This object is available in API version 41.0 and later.")
- [_Salesforce DX Developer Guide_](https://developer.salesforce.com/docs/atlas.en-us.264.0.sfdx_dev.meta/sfdx_dev "
    Salesforce DX Developer Guide 
    - HTML (New Window)")