Salesforce provides several standard fields, but every business is unique so we need to create our own custom fields in Salesforce objects. We can create new custom fields in Salesforce for custom objects and standard objects.
In our previous Salesforce tutorial, we created our custom Certification object and what are the different fields in Salesforce. Now we will learn how to create new custom fields in Salesforce and create relationship field to connect certification to contacts.
Fields in Salesforce.com, will capture information on these objects. To create new custom fields in Salesforce follow the steps given below:
Goto the Setup > Object Manager tab, you can see how we begin the process of creating this field. There are four custom fields that were automatically created when the Salesforce custom object was created. They are
- Certification Number.
- Created By.
- Last Modified By
Now in Certification object, we will create a custom field to establish master-detail relationship between Certification object and contact object.
As shown above, there are two types of internal relationships .You can choose a Lookup Relationship, which allows you to look up any object and connect the certification object. Here we chose to make this as Master-Detail Relationship, which means that the certification has to have a contact before it can be created. This makes sense because if the contact were to be deleted, the certification would have no use for the certification records related to that contact in Salesforce.
After selecting an internal relationship, click Next.
The following screenshot shows the next screen in the field creation sequence:
Next, we choose the related object as contact and click on next button.
- The following screenshot allows us to add some details about this field:
- Here, we added the Field Label and API name, as well as a Description and optional Help Text.
- In sharing options. We chose Read/Write as the minimum sharing access on the contact record so that we can create a certification record.
- Optionally, you can add a Lookup Filter to allow a certification record to be created for certain types of contacts. We won’t create one for this example
- Click Next to proceed to the next step.
- The next step is to set the field-level security for the new field.
- Next we can choose which profiles.
- On the next page, you can add the field to specific layouts:
- The Related List Label of Certifications that will show up on the contact record.
- The contact page layouts to add this related list to.
- Save to finish creating the field.
Successfully we have created new Custom fields in Salesforce. The relationship field is very important because it ties two objects together. Next, let’s take a look at custom page layouts for the new object and its related fields.