Salesforce Apex Tutorial – Chapter 3: Apex Examples

Salesforce Apex Tutorial – Chapter 3: Apex Examples

On September 29, 2021, Posted by , In Salesforce Apex Tutorial, With Comments Off on Salesforce Apex Tutorial – Chapter 3: Apex Examples

Here we will use the Developer Edition Environment of salesforce and In this example, we will discuss object and field creation in Salesforce and how to use them in code for implementing business logic.

You can read Salesforce Apex Tutorial – Chapter 2: Apex Environment and the next article Salesforce Apex Tutorial – Chapter 4: Data Types In Apex.

Below are the steps to create objects and fields in salesforce.

Step 1: Go to Setup click object manager and then click on Create button, select custom object to create custom object an as shown in below images

Salesforce Apex Tutorial - Chapter 3- Apex Examples 1
Salesforce Apex Tutorial – Chapter 3- Apex Examples 1

Step 2: After clicking on create object a form will appear where you can fill in the details of the object and click save.

Step 3:  Once you created the object now it’s time to create fields. To create fields click on fields and relationships from the side pan, a new page will appear with several buttons like New, Deleted field click on New as shown in below image.

Salesforce Apex Tutorial - Chapter 3- Apex Examples 4
Salesforce Apex Tutorial – Chapter 3- Apex Examples 4

Step 4:  After clicking on the New button a new page will appear with a list of data types from which you can select the data type for the field you want to create.

Salesforce Apex Tutorial - Chapter 3- Apex Examples 5
Salesforce Apex Tutorial – Chapter 3- Apex Examples 5

Step 5: Enter the Information of the field and click Next as shown in the below screenshot.

Step 6: Click on the Visible check box and the Next as shown in the below screenshot.

Salesforce Apex Tutorial - Chapter 3- Apex Examples 7
Salesforce Apex Tutorial – Chapter 3- Apex Examples 7

Step 7: Click on Save or Save and New for creating more fields.

Salesforce Apex Tutorial - Chapter 3- Apex Examples 8
Salesforce Apex Tutorial – Chapter 3- Apex Examples 8
Comments are closed.