sobject Commands

Commands to interact with Salesforce objects.

sobject describe

Display the metadata for a standard or custom object or a Tooling API object.

Description for sobject describe

The metadata is displayed in JSON format. See this topic for a description of each property: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_describesobjects_describesobjectresult.htm.

This command displays metadata for Salesforce objects by default. Use the --use-tooling-api flag to view metadata for a Tooling API object.

Examples for sobject describe

Display the metadata of the "Account" standard object in your default org:

1sf sobject describe --sobject Account

Display the metadata of the "MyObject__c" custom object in the org with alias "my-scratch-org":

1sf sobject describe --sobject MyObject__c --target-org my-scratch-org

Display the metadata of the ApexCodeCoverage Tooling API object in your default org:

1sf sobject describe --sobject ApexCodeCoverage --use-tooling-api

Flags

--json
Optional

Format output as json.

Type: boolean
--flags-dir FLAGS-DIR
Optional

Import flag values from a directory.

Type: option
-o | --target-org TARGET-ORG
Required

Username or alias of the target org. Not required if the `target-org` configuration variable is already set.

Type: option
--api-version API-VERSION
Optional

Override the api version used for api requests made by this command

Type: option
-s | --sobject SOBJECT
Required

API name of the object to describe.

Type: option
-t | --use-tooling-api
Optional

Use Tooling API to display metadata for Tooling API objects.

Type: boolean

Aliases for sobject describe

1force:schema:sobject:describe

sobject list

List all Salesforce objects of a specified category.

Description for sobject list

You can list the standard objects, custom objects, or all. The lists include only Salesforce objects, not Tooling API objects.

Examples for sobject list

List all objects in your default org:

1sf sobject list --sobject all

List only custom objects in the org with alias "my-scratch-org":

1sf sobject list --sobject custom --target-org my-scratch-org

Flags

--json
Optional

Format output as json.

Type: boolean
--flags-dir FLAGS-DIR
Optional

Import flag values from a directory.

Type: option
-o | --target-org TARGET-ORG
Required

Username or alias of the target org. Not required if the `target-org` configuration variable is already set.

Type: option
--api-version API-VERSION
Optional

Override the api version used for api requests made by this command

Type: option
-s | --sobject SOBJECT
Optional

Category of objects to list.

Type: option
Default value: ALL

Aliases for sobject list

1force:schema:sobject:list