Getting Started With Salesforce: A Brief Walkthrough

Anto Gibson
13 min readAug 13, 2023

Start by logging in to your Salesforce account. Get familiarized with the home page.

  • The objects panel will help you surf through different objects, both standard and custom objects.
Salesforce Home Page-How To Create Custom Objects In Salesforce
Salesforce Home Page
  • The More dropdown contains all the objects that are not shown in the panel.

In the top right corner, various icons lead us to different pages.

  1. Settings
  2. Profile
  3. Global Actions

Clicking on the objects in the panel will direct you to the object page where the related fields to that object will be shown. And there will be a details page for each object as well. You can click through and see for yourself.

Setup Page:

Click on the settings icon and the dropdown there which consists of two crucial options.

  1. Setup.
  2. Developer Console.

The developer console will redirect you to the CLI where you can start coding and explore the class files in Salesforce whereas, the setup will take you to the page where you can change the settings for your entire Salesforce account and the data tables in it.

Salesforce Setup Page
Salesforce Setup Page

The above image is a setup page in Salesforce and the two search bars, Quick Find and Search Setup will be the most helpful ones on this page, as they make surfing through this page easier.

How To Create Custom Objects In Salesforce?

On the top panel, you can see the Object Manager drop-down link. You can either select the link or click on the drop-down and find the New Object option.

If you select the link, you will be redirected to the page shown below which is the object manager page.

Object Manager Salesforce
Object Manager Salesforce

On the create dropdown we have the Custom Object option. Click on that to open the create custom object wizard. If you want to edit an object created already or add new fields to an existing object, you can select that specific object from the list below. Or search for your object on the Quick Find bar above.

Custom Object Information:

The below details should be filed in the custom object creation page, and make sure you give the necessary data according to your preference.

  1. Object Name — Your API name will be followed by “__c”
  2. Label — How the object will be displayed on the Home page/ in general how the object will be depicted as.
  3. Help Page — How your object help page should be. (Upon choosing the 2nd option, You should’ve created a visual force page in advance)

Enter Record Name Label and Format:

This section contains data for two in-built fields for each custom object. The name and unique ID if it is needed.

But this ID field is different from the actual ID of the table. There will be a default table ID and if you need an autonumbering field you can choose the options as shown below.

If you don't need the auto numbering field, do not make any changes to the Data Type dropdown.

The rest of the sections are self-explanatory. You can check and uncheck the fields as per your requirement. But for the most part, it will not make any change if left as it is.

But make sure to check this one field that is shown in the image below.

Launch New Custom Tab Wizard

Your custom object will be visible on the panel only if it has a tab for itself. So make sure to check that option and complete a small procedure there.

Click Save if you are done with object creation. Select Save and New for bulk object creation.

Types Of Objects In Salesforce:

Salesforce consists of two types of objects namely,

  1. Standard objects. Example: Account, contact, Asset, etc.
  2. Custom Objects. These are the objects that you create using the method above.

Standard objects exist by default on every salesforce account with certain fields within. You can make use of them by editing the object display name and adding new fields.

They also exist in related fields as well. Example: The contact object is related to the Account object such that, Account will be the parent object, which is related to multiple contact objects as children.

How To Edit or Add Custom Fields In Salesforce Objects?

Once you have created your custom object it is time you add new fields to them or edit the pre-existing objects and add new fields. Head on to the object manager page once again.

Use the quick find bar to find your desired object (Could be a standard object or a custom object) and then click and open the object editing page.

For demonstration, I will be using the standard object, Account. Once you open your object you will be landing on the details page and to the left side you can see the panel that consists of different components of an object that can be edited. Click on the Fields & Relationships option.

Data Types In Object fields:

Field datatypes Salesforce
Field datatypes Salesforce

The above image shows all the data types present in Salesforce for an object’s field. Each serves a unique duty. So, it is essential to know about them. Among all the data types, most are self-explanatory and also it has been clearly explained in the description to the right of each data type.

So, I will skip to the three tedious but important fields to understand namely,

  1. Roll-Up Summary.
  2. Look-Up Relationship.
  3. Formula.

Roll-Up Summary:

As the name suggests this is a summary field, used often to summarize a specific field from its child objects on the main parent object.

Example: Let us take the Account object and if you are adding a roll-up summary field named total income, you will have to select a field from one of its children objects. So, let us choose the contact object and select a currency data type field from the contact object. Now, the income from all the contacts that are related to a specific parent Account will be added and posted in this summary field as total income.

In addition to this, the roll-up summary also provides options to show the count of the child objects and the minimum or maximum of your desired fields from the child objects as shown below.

Roll-Up Summary Salesforce

Look-Up Relationship:

This is a field that stores the ID of another object just as a reference in this object. Example: Account Object is saved as a reference in the contact object and each Account object may contain multiple contact objects and all these child contact objects will have the same account object displayed in this related field.

In the below pictures, It is clear that in Mr. Last’s (Contact) detail view, we can see the related account’s name has been mentioned. And on the second image, you can see on aSDFN’s (Account) related page, The contact Mr.Last is displayed. This is how the related fields in Salesforce work.

Contact Details Salesforce
Related Account Salesforce

Formula:

As the name states this is a field that uses two or more fields to calculate value and store it. This results in an uneditable field that can only be changed by changing the values that are associated with the formula.

Example:

I have added 3 new custom fields to my Account object.

  1. IncomeperDay
  2. no.of.days
  3. Now Income

The first two are just currency data types and the third one is a formula field. And the formula for the field is

Now Income = IncomeperDay / no.of.days.

In the below image, the values have been updated accordingly on the formula field. Also, notice how there is an edit option available for the other two fields but not for the formula field. As a result, many use this formula field to maintain data that is constant through the application like a constant text or constant number that can be just typed in during the creation of a formula field. (Can also be edited later on)

Formula Field Salesforce

Coming back to adding custom object fields wizard, navigate to the fields and relations tab inside the edit object page. Click on the new button in the top right corner and choose your preferred data type. For demonstration, I will be creating a picklist to select gender in the Account object.

There are two types of picklists available, single-selection and multi-selection. Pick one based on your requirement and click on the Next button.

On the upcoming page, name your field and update the rest of the values using the below example as a reference.

Pick List Salesforce

You can use the global picklist value set, but that is a tedious process compared to the one shown above. But you can try and use global values if you are comfortable. The Required checkbox underlined with green, will make this field mandatory so that a new object instance will not be inserted into the data table without entering value in this field.

But since this is gender I set the default value as the first value on the picklist. You can change that according to your requirement. Click next and that’s just the field-level security window where you can set which level of people can access the values in this field. We can hide certain fields if you’re using the checkboxes correctly. But for now, don't change anything and click on next.

This is the layout selection page, to make sure what layouts you are showing this field and on which layouts this field will be hidden.

Again for now just don't make any changes there and click on save. Now if you go back to your home page and check your object, you can find the newly added field there.

If you can’t find this new field, try refreshing and reloading your object page. When this doesn’t work go to your object manager again and go to the Page-Layout tab and make sure your new field is placed inside the layout as shown in the image below.

page-layout Salesforce

Once all those are set properly, you must be able to access this newly added field in your object.

Read the previous articles for more clarity in Salesforce…

Does Salesforce Require Coding?

Most of Salesforce's work doesn't need coding, but Salesforce does work with coding and Apex is the core language used. Both front end and back end, Salesforce has its coding language that is what Salesforce was built with and is also available for us to create our products.

So, let me list down and explain briefly all the technical things below.

Apex Classes:

Apex classes are no different than any normal C# class. If you are familiar with C# or any C-related languages Apex is so similar.

Apex classes are classified into the below categories:

  1. Trigger Class.
  2. Controller Class.
  3. Batch Class.
  4. Schedule Class.

Among them, a controller class can be an API class and a Batch class can be a schedule class. Keep reading to learn more about them.

Note: To start creating your own apex classes, open the developer console from the setup icon. Then on the top panel open Files-> New -> Apex Class/ Apex Trigger and start coding.

Controller Class:

The controller class is the basic form of an Apex class, which is defined as a namespace and has a set of functions. Usually, any class that is defined and referred to in a visualforce page (Apex pages) is called a controller. A controller becomes a wrapper class when it just has properties and is used to store data in them.

The below code snippet will help you distinguish between a wrapper and a controller class.

//Controller Class
public class ButtonDemoPageController {
public string userName{get;set;}
public string Password{get;set;}
public boolean valid {get;set;}
public String buttonStyle { get; private set; }

public void ButtonDemoPageController(){
valid = false;
}
public PageReference validateCredentials() {
if( !String.isBlank(username) && !String.isBlank(Password)){
valid = true;
}else{
valid = false;
}

if (valid) {
buttonStyle = 'valid';
} else {
buttonStyle = 'invalid';
}
return null;
}
}

//Wrapper Class
public class AccountDummyWrapper {
public string Name{get;set;}
public string Gender{get;set;}
public boolean IsNew {get;set;}
public decimal Salary {get;set;}
public integer LeavesAvailable {get;set;}
}

As shown above, the wrapper class has properties and it can be used as an info storage object where as the Controller class contains methods that can be used on other classes or any pages. Using this functionality a network of operations can be created.

Trigger Class:

Normal apex class becomes a trigger class when you add the following syntax to the class definition.

trigger triggerName on triggerObject(after insert, after update) {//replace 'triggerObject' with the object you want toyour trigger with
if(Trigger.isAfter && (Trigger.isUpdate || Trigger.isInsert)){
triggerObject = Trigger.new[0]; //Trigger Data
//Define your operations here for after update or insert
}
if(Trigger.isAfter && Trigger.isDelete){
// Define your operations for after delete
}
}

A trigger class when defined and saved, gets called automatically whenever the pre-defined action (Insert, Update, Delete) happens in our salesforce data table.

So, the basic data table operations include,

  • Insert
  • Update
  • Delete

A trigger can be called either before or after any of the operations by using the isAfter or isBefore properties available within triggers.

Note: Trigger data always comes in list, so make sure to handle the trigger data properly.

Batch Class:

In apex, it is not allowed to do more than a certain number of operations in the data table. As an example, in your basic class Insert operation, more than 200 DML requests are not possible. This also includes SQL calls to retrieve data.

So, to overcome such problems, a batch class is used.

An apex batch class is a specially designed class to operate with bulk data from the data table and can convert those data into data chunks. It has three main operating blocks namely, Start, execute, and finish.

For example, we can retrieve or update 1000 data objects using a batch class, with 20 objects per chunk. Use the below syntax to kick-start your first batch class operation.

public class DummyBatch implements Database.Batchable<SObject> {

// Implement the start method to provide the initial set of records to process
public Database.QueryLocator start(Database.BatchableContext context) {
String query = 'SELECT Id, Name FROM Account';
return Database.getQueryLocator(query);
}

// Implement the execute method to process each batch of records
public void execute(Database.BatchableContext context, List<Account> scope) {
// In a real scenario, you would perform actual data processing here
// For this example, we're just printing the names of the accounts
for (Account acc : scope) {
System.debug('Processing Account: ' + acc.Name);
}
}

// Implement the finish method to perform any cleanup or final operations
public void finish(Database.BatchableContext context) {
System.debug('Batch processing completed.');
}
}

//Batch Class Invocation
DummyBatch batch = new DummyBatch();
Database.executeBatch(batch);

On the above code block, the start method will retrieve the list of Accounts. And in the execute method for each account, the account name will be printed on the debug log. And then at the finish block the message Batch processing completed will be printed.

That is a brief explanation for the above demo batch class. And once you have saved this batch class, you can head to another class to invoke this or you can do it on the Developer Console’s Annonymous Window.

Schedule Class:

Apex classes can be defined so that they get executed automatically at a certain time. Such classes are called scheduled classes because they are scheduled to run.

Example:


//Scheduleable Class
public class DummyScheduled implements Schedulable {

// Implement the execute method to define the scheduled task
public void execute(SchedulableContext sc) {
// In a real scenario, you would perform actual scheduled tasks here
// For this example, we're just printing a message
System.debug('Scheduled task executed at: ' + Datetime.now());
}
}


//Scheduling
String scheduleTime = '0 0 0 1 1 ?'; // Cron expression (e.g., midnight on January 1st)
DummyScheduled scheduledJob = new DummyScheduled();
System.schedule('Dummy Job', scheduleTime, scheduledJob);//two jobs cant be scheduled with same name

Cron expression or the string used to schedule the class is very crucial, to understand properly. The below examples will help you to understand it in detail.

'0 0 * * * ?: Run daily at midnight'
'0 0 15 * * ?: Run daily at 3:00 PM'
'0 30 10 ? * MON-FRI: Run at 10:30 AM from Monday to Friday'
'0 0/30 * * * ?: Run every 30 minutes'
'0 0 1 1 ?: Run on January 1st at 1:00 AM'

So, from the first to last this is what represented in the cron string,

  1. Minute
  2. Hour
  3. Day of the Month
  4. Day of the Week Year (Optional)

Now read the above cron string examples again, it should give you a rough idea of how cron strings work.

So to summarize, first create a schedulable class and then schedule the class to run periodically using proper cron string.

Note: Once you have scheduled a class, it runs as a scheduled job, and you cannot make changes to this schedule class unless that scheduled job is stopped.

Note: All apex classes can be scheduled except APIs and triggers.

How to Stop a Scheduled Job In Salesforce?

Head on to your salesforce setup Home page. Then, on the panel on the left, scroll and find Platform Tools -> Environments -> Jobs -> Scheduled Jobs.

There all the jobs that are active or scheduled will be listed. Now you can delete your desired job using the delete option.

How to Schedule a Batch Class In Salesforce?

You can schedule an apex Batch class by adding the following class definition property. “implements Database.Batchable<SObject>, Schedulable” adding these into your class definition makes them batchable and scheduleable. Then you can use a cron string to schedule it as usual.

Here is a modified code snipet of the above used batch class.

//Schedulable Batch Class
public class MySchedulableBatch implements Database.Batchable<SObject>, Schedulable {
// Implement the start method to provide the initial set of records to process
public Database.QueryLocator start(Database.BatchableContext context) {
String query = 'SELECT Id, Name FROM Account';
return Database.getQueryLocator(query);
}

// Implement the execute method to process each batch of records
public void execute(Database.BatchableContext context, List<Account> scope) {
// In a real scenario, you would perform actual data processing here
// For this example, we're just printing the names of the accounts
for (Account acc : scope) {
System.debug('Processing Account: ' + acc.Name);
}
}

// Implement the finish method to perform any cleanup or final operations
public void finish(Database.BatchableContext context) {
System.debug('Batch processing completed.');
}
}

//Batch Class Invocation
DummyBatch batch = new DummyBatch();
Database.executeBatch(batch);

--

--

Anto Gibson

Coder, Software Developer, Author and gamer. Need web page designs or Coding guidance or Writing help? Contact me through mail natmotgobin@gmail.com