Object Reference
Custom Objects
Creating New Custom Object
In scratch orgs, go to Setup → Object Manager. Click Create → Custom Object.
Fill required fields, with the following optional:
Allow Search
Add notes and attachments
Click on for
Launch New Custom Tab Wizard after saving this custom object
.Add the field in Setup -> Permission Set -> [PERMISSION_SET] -> Object Settings -> [OBJECT] , enable Tab Settings, Object Permissions.
Click save
To create record page, use Highlight Panel
and Tabs
for the components.
Renaming Custom Object
Backup the data in the current custom object
Create a new custom object
Push to prod
Delete the old custom object in prod
If renaming custom object is performed in scratch orgs and then pushed to a prod, it will automatically delete the old object and replace with the new custom object. You will lose all data in the old object.
Deleting Custom Object
Go to Permission Set, Profile, Tabs, then remove all checkmarks related to this Custom Object
Pull the metadata using
sf org pull --targetusername scratch
Go to Setup - Object Manager - Click Object - Click Delete
Pull the metadata again using
sf org pull --targetusername scratch
Custom Fields
Adding New Custom Field
Add new field through
Setup -> Object Manager
, choose name, field type, etc.Add the field in
Setup -> Object Manager -> <OBJECT> -> Page Layouts
. Use the drag and drop to input to details section.Save by performing
sf pull
to pull the metadata changes from scratch orgs to the codes in Git.
Retrieving a field value from another lookup field
Use
formula
fieldSelect Formula Return Type
Click on
Advanced Formula
, thenInsert Field
You should be able to use lookup field value
Example usage: show percentage in Opportunity.Probability from Account.Type field
Add new field: Master-Detail Relationship
If A has multiple B , you need to add master-detail relationship from B.
In Campaign Member Object, Status Field, how to change picklist value
The Status field on the Campaign Member object cannot be updated using the Standard field. This is because the Campaign Member Status field is record-based, meaning its value can differ for each individual record. To resolve this limitation and update the Status field on Campaign Member records, follow these steps:
Go to Setup → Object Manager. Find or search for ‘Campaign’ → Find ‘Page Layouts’ in the sidebar → click to edit the ‘Campaign Layout’.
Scroll down the list to find “Related Lists.” Drag the “Campaign Member Status” related list onto the page. Then save.
When you create a Salesforce Campaign, you don’t need to create Campaign Member Statuses because there are two default Campaign Member Statuses: Sent and Responded. You can use or modify these, or create additional ones to suit your campaign needs. To edit an existing status, use the dropdown arrow and click on the Edit option.
Deleting Custom Field
In scratch org, go to Object Manager → Custom Object → Fields → Click Delete → Confirm Delete. Then, perform
sf pull.
In prod, go to Object Manager → Custom Object → Fields → Click Delete → Confirm Delete
Last updated