Newer Version Available

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

ScratchOrgInfo

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.

Supported Calls

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

Fields

Field Name Details
AdminEmail
Type
email
Properties
Create, Filter, Group, Nillable, Sort
Description
The email address of the scratch org’s Administration user. The read-only SignupEmail field is populated with this value. If you don't provide a value for AdminEmail, the field is left blank and the SignupEmail is populated with the email address of the org user who is creating this object.
AuthCode
Type
string
Properties
Filter, Group, Nillable, Sort
Description
A one-time authorization code that can be exchanged for an OAuth access token and refresh token using standard Salesforce APIs. It’s used with ConnectedAppCallbackUrl and ConnectedAppConsumerKey, when the specified connected app hasn't been configured with an X.509 certificate. This field is read-only.
ConnectedAppCallbackUrl
Type
textarea
Properties
Create
Description
When used with ConnectedAppConsumerKey, specifies a connected app that is approved automatically during the scratch org creation.
ConnectedAppConsumerKey
Type
string
Properties
Create, Filter, Group, Sort
Description
When used with ConnectedAppCallbackUrl, specifies a connected app that is approved automatically during the scratch org creation.
Country
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
The two-character, upper-case ISO-3166 country code. You can find a full list of these codes at several sites, such as: www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html. The language of the scratch org is auto-determined based on the value of this field. If you do not specify a value, this field defaults to the Dev Hub’s country code.
DeletedBy
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The user who requested that the scratch org be deleted. This field is read-only.
DeletedDate
Type
date
Properties
Filter, Group, Nillable, Sort
Description
The date when the DeletedBy user requested that the scratch org be deleted. This field is read-only.
Description
Type
textarea
Properties
Create, Nillable, Update
Description
A free-form text field for you to enter a description of this scratch org.
DurationDays
Type
int
Properties
Create, Filter, Nillable, Group, Sort
Description
Number of days after which the scratch org expires. Valid values are 1–30. The default is 7.
Edition
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort
Description
The org edition of this scratch org. Valid values are Group, Developer, Enterprise, and Professional.
ErrorCode
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The error code if the scratch org creation isn’t successful. 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
Create, Nillable
Description
A semi-colon delimited list of the features enabled in this scratch org, such as MultiCurrency. See the Salesforce DX Developer Guide for the full list of valid features.
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.
Language
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort
Description
The language of the scratch org being created. Specify the language using a language code listed under "Supported Languages" in Salesforce Help. For example, use zh_CN for simplified Chinese. The value you select overrides the language set by locale.
If you don’t specify a value, the language is based on the Country used during scratch org creation. If you don’t specify a value for Country, the value defaults to the Dev Hub’s country.
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 date this scratch org was last referenced. This field is read-only.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date this scratch org was last viewed. This field is read-only.
LoginUrl
Type
textarea
Properties
Nillable
Description
A URL that logs you in to the scratch org. 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
Create, Filter, Group, Nillable, Sort
Description
The namespace you want to associate with this scratch org. The value of this field corresponds to the NamespacePrefix field of the NamespaceRegistry object that describes your namespace.
OrgName
Type
string
Properties
Create, Filter, Group, Sort
Description
The name of the scratch org.
OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
The ID of the user who created this scratch org.
Release
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
Description
The release of the scratch org. During Salesforce's major release transitions, this field allows you to select the Salesforce release version, based on the version of your Dev Hub. This field is available in API version 46.0 and later. Valid values are:
  • Current
  • Preview
  • Previous
See Select the Salesforce Release for a Scratch Org for more information.
ScratchOrg
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The org ID of the scratch org. This field is read-only.
SignupCountry
Type
string
Properties
Filter, Group, Sort
Description
The country code of the scratch org. This field is populated with the value of the Country field. If you didn’t provide a value for Country, it’s the country code of the Dev Hub. This field is read-only.
SignupEmail
Type
email
Properties
Filter, Group, Sort
Description
The email address of the scratch org’s Administration user. This field is populated with the value of the AdminEmail field. If you didn't provide a value for AdminEmail, it's the email address of your user in the Dev Hub. 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.
SignupLanguage
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The language of the scratch org. This field is populated with the value of the Language field. If you didn’t provide a value for Language, it’s the language of the Dev Hub. 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, Sort
Description
The username of the Administration user of this scratch org. This field is populated with the value of the Username field. If you didn’t provide a value for Username, the value of this field is auto-generated. This field is read-only.
SourceOrg
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
The ID of the org whose shape (features, settings, limits, and licenses) information is used for creating scratch orgs.
Status
Type
picklist
Properties
Defaulted on create, Filter, Group, Restricted picklist, Sort
Description
The status of the scratch org, such as active, expired, or deleted. This field is read-only.
Username
Type
string
Properties
Create, Filter, Group, Nillable, Sort
Description
The username of the Administration user of this scratch org.

Associated Objects

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

ScratchOrgInfoFeed
Feed tracking is available for the object.
ScratchOrgInfoHistory
History is available for tracked fields of the object.
ScratchOrgInfoOwnerSharingRule
Sharing rules are available for the object.
ScratchOrgInfoShare
Sharing is available for the object.