Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Create a Custom Object
- Open a terminal (macOS and Linux) or command prompt Windows and change to your Salesforce DX project directory.
-
Run the interactive schema generate
sobject command. You must specify a label for your new custom
object with the --label flag. The command
uses this label to provide intelligent suggestions for other object properties,
such as its API name and plural label.
1sf schema generate sobject --label "New Object"Answer all the questions about your new object, such as the location of the generated files in your Salesforce DX project and whether to enable various object properties.
- Create a custom field on your new object with the interactive schema generate field command, which generates the necessary metadata files in your project. You can also use the command to create a custom field on a standard object, such as Account.
- Create a custom tab for your new object with the schema generate tab command.
Then deploy your new custom object to your org.
1sf project deploy start --metadata CustomObject:NewObject__c --target-org myscratchThe first time you deploy your new custom object to a source-tracking org, the org creates additional properties and sets new defaults on it. For this reason, we recommend that you immediately retrieve the custom object so your local source files are updated with this new information.