Skip to main content

The Salesforce MasterClass





 Salesforce Master Class 1.0



  • Overview

  • Orgs

  • Developer Console

  • Setup

  • Objects

  • Object Relationship

  • Object Manager

  • Page Layout

  • Multitenant Architecture

  • Governor Limits

  • Metadata

  • Standard Objects

  • Custom Objects

  • Fields

  • Formula Fields

  • Roll Up Summary Fields

  • Master Detail Relationship

  • LookUp Relationship

  • Validation Rules

  • Web to Lead



  • Chatter

  • Schema Builder

  • Workflow Rules

  • Process Builder

  • Workflow vs Process Builder



Salesforce Master Class 2.0




  • Apex Triggers

  • Visual Flow

  • Apex

  • Visualforce

  • Static Resources

  • SOQL

  • SOSL

  • SOQL vs SOSL

  • Workbench

  • DML

  • Lightening Components/Aura

  • Lightening Web Components

  • Lwc vs Aura

  • Lightening Design System

  • Apex Test Class

  • Approval Process

  • Reports 

  • Dashboards

  • Data Loader, Import wizard

  • Salesforce Data Security

  • Apex CallOuts



  • Integration

  • Public Groups, Sharing Rules

  • Sandbox and Production

  • Change Set

  • Deployment





Salesforce Master Class 1.0



Overview - Salesforce Classic


Salesforce Classic is the earlier version of the UI which was provided within the Salesforce Application and to some extent is used today as well.


Overview - Salesforce Lightning


This is an updated platform of Salesforce where Salesforce has offered a brand new attractive UI for us.


Org


An org is nothing but an organization which consists objects, classes, pages, sites, user records, apps, etc.


  1. Go to https://developer.salesforce.com/signup.

  2. Enter your contact information.

  3. Enter a unique username.

  4. Submit the form, and wait for your welcome email.

  5. In the welcome email, click the link to set your password.



Developer Console


This is the place where you can write any custom code in Apex, Visualforce or Lightening and also you can execute your SOQL or SOSL queries.


Setup


This is a navigation menu from where you can navigate to any important application or section within Salesforce.


Inorder to navigate you can use the Quick Find search box.


Objects


In Salesforce the database tables can be considered as each object where fields can be understood as column names in that table and records are the values of the rows in that the table.


Standard Objects


Salesforce provides some out of the box objects also known as standard objects which are most commonly used in a CRM like account object, contact object, lead object etc.


Custom Objects


Any object which is created to meet business requirement and not provided out of the box by Salesforce.


Represented as __c


Eg. Property__c



Object Relationships


Parent-to-Child Relationships


  • Master-Detail (Tightly Coupled)

  • Lookup (Loosely Coupled)


Master Detail


 The Master Detail relationship is used when we want to control the display of detail records based on the value in the master record.


Eg. Property and Offers

Now, lets say a property is deleted so does all offers related to it shall be removed. Thus it is tightly coupled.


LookUp Relationship


A Lookup relationship involves finding value of a field based on the value in another field in another object. It is mostly used in the case of commonly shared data between two objects.


Account to Contact, the relationship between the two objects is a lookup relationship.


While lookup relationships are fairly casual, master-detail relationships are a bit tighter. The master object controls certain behaviors of the detail object, like who can view the detail’s data.


Link -> 

https://trailhead.salesforce.com/content/learn/modules/data_modeling/object_relationships



Page Layout


Page layouts control the layout and organization of buttons, fields, s-controls, Visualforce, custom links, and related lists on object record pages. They also help determine which fields are visible, read only, and required. Use page layouts to customize the content of record pages for your users.


Object Manager


This is the place where you can create or manipulate objects based on requirement.


Meta data


Hard-coded applications are a thing of the past; customization is the flair of the season.

You need flexible applications that can be tailor-made as per your business needs without the need for high-level programming skills. That is why Salesforce Metadata is so powerful. Metadata is what transforms Salesforce from a simple database into an entire platform.

Data about Data is called Metadata. Can be accessed using metadata api.




Multitenant Architecture


To meet the extreme demands of its large user population, Force.com's foundation is a metadata- driven software architecture that enables multitenant applications


Think of it like multiple people renting a single building where they share the same water supply and electricity.


Governor Limits


Because Apex runs in a multitenant environment, the Apex runtime engine strictly enforces limits to ensure that runaway Apex code or processes don’t monopolize shared resources.


  • Total number of SOQL queries issued : 200

  • Total number of SOSL queries issued : 20

  • Total number of DML statements issued : 150

  • Total number of records retrieved by SOQL queries : 50,000

  • Total number of records processed as a result of DML statements : 10,000

  • Maximum cumulative timeout for all callouts (HTTP requests or Web services calls) in a transaction : 120 seconds




Fields


A field is like a custom Database column. Object field Store the data for our records.


Eg. Account Id, Account Name etc


Formula Fields


Formula fields will automatically calculate values for that field based on the formula we have entered.


Eg. 

Calculate days to close 






Validation Rules


Creating a Validation Rule

  1. From Setup, go to Object Manager and click Account.

  2. In the left sidebar, click Validation Rules.

  3. Click New.

  4. Enter the following properties for your validation rule:

    1. Rule Name: Account_Number_8_Characters

    2. Error Condition Formula:

    3. LEN( AccountNumber) != 8

  5. Error Message: Account number must be 8 characters long.

  6. To check your formula for errors, click Check Syntax.

  7. Click Save to finish.



Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns a value of “True” or “False”.





Web to Lead


The process of using a website form to capture visitor information and store that information as a new lead in Salesforce. Salesforce lets you can easily create web-to-lead forms that capture information about visitors to your website.

Link->https://www.salesforcetutorial.com/salesforce-web-to-lead/



Chatter


Salesforce Chatter is a free social collaboration tool similar to Facebook and Twitter, but for organizations on the Salesforce.com platform. Chatter allows users to collaborate securely at work to establish networks, share files and status updates.


Roll Up Summary Field


A roll-up summary field calculates values from related records, such as those in a related list. You can create a roll-up summary field to display a value in a master record based on the values of fields in a detail record. The detail record must be related to the master through a master-detail relationship.


Roll Up Summary Field


Steps -


  1. From Setup, open Object Manager and click Account.

  2. On the left sidebar, click Fields & Relationships.

  3. Click New.

  4. Choose the Roll-Up Summary field type, and click Next.

  5. For Field Label, enter Sum of Opportunities and click Next.

  6. The Summarized Object is the detail object that you want to summarize. Choose Opportunities.

  7. Choose the SUM summary type and choose Amount as the Field to Aggregate.

  8. Click Next, Next, and Save.



Schema Builder


Schema Builder provides a dynamic environment for viewing and modifying all the objects and relationships in your app. This greatly simplifies the task of designing, implementing, and modifying your data model, or schema


Workflow Rules


A workflow rule is the order created by a Salesforce user to perform an automated action when another condition or series of conditions have taken place. These actions can happen instantly, or they can be set to operate after a certain amount of time.


Process Builder


Process Builder is a point-and-click tool that lets you easily automate if/then business processes and see a graphical representation of your process as you build.


Work Flow Rules vs Process Builder


Workflow -


  • Update a field

  • Send an email

  • Create a Task

  • Send an outbound message



Process Builder -


  • Create a record (not just Tasks!)

  • Update related records

  • Launch a Quick Action

  • Post to Chatter

  • Launch a Flow

  • Call Apex code

  • Submit for approval

  • Invoke another process





Salesforce Master Class 2.0



Visual Flows


  • Can create guided screens

  • Setup automated tasks and processes

  • Connect to external systems

  • Add automation to your pages and apps.

  • Reuse what you built

  • Call Apex

  • Create/Update records

  • Create screens for user interaction


Eg. User enters contact info->Lookup->If user exists->display user info->else creates user.

...Analogous to Switch Case(Complex solutions)


Apex Trigger


trigger TriggerName on ObjectName (trigger_events) 

{

   code_block

}


********Example********


trigger ExampleTrigger on Contact (after insert, after delete) {

    if (Trigger.isInsert) {

        Integer recordCount = Trigger.New.size();

        // Call a utility method from another class

        EmailManager.sendMail('Your email address', 'Trailhead Trigger Tutorial', 

                    recordCount + ' contact(s) were inserted.');

    }

    else if (Trigger.isDelete) {

        // Process after delete

    }

}


Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions. 



Apex


Apex is a proprietary language developed by Salesforce.com. It is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Force.com platform server in conjunction with calls to the Force.com API.


Account acct = new Account(Name='Acme', Phone='(415)555-1212', NumberOfEmployees=100);

// Insert the account by using DML

insert acct;


Visualforce


<apex:page standardController="Contact" >

    <apex:form >

        <apex:pageBlock title="Edit Contact">

            <apex:pageBlockSection columns="1">

                <apex:inputField value="{!Contact.FirstName}"/>

                <apex:inputField value="{!Contact.LastName}"/>

                <apex:inputField value="{!Contact.Email}"/>

                <apex:inputField value="{!Contact.Birthdate}"/>

            </apex:pageBlockSection>

            <apex:pageBlockButtons >

                <apex:commandButton action="{!save}" value="Save"/>

            </apex:pageBlockButtons>

        </apex:pageBlock>

    </apex:form>

</apex:page>


Visualforce is a framework that allows developers to build sophisticated, custom user interfaces for Salesforce Platform.

Its a markup language like Html.


Static Resources


Static resources allow you to upload content that you can reference in a Visualforce page. Resources can be archives (such as . zip and . jar files), images, stylesheets, JavaScript, and other files.


  1. From Setup, enter Static Resources in the Quick Find box, then select Static Resources, and then click New.

  2. Enter jQuery for the Name.

  3. Click Choose File, and then choose the jQuery JavaScript file you downloaded previously.



Lightening Components / Aura Components


Lightning Components are a user interface (UI) framework that is used to create applications for desktop and mobile technologies.

Lightning Component architecture lets developers use a standardized JavaScript framework that isn’t held back by some of Visualforce’s limitations.

  • Lightning Components create a better, faster web experience for customers.

  • Increase page speed and loading performance.

  • Make the app/page mobile responsive.

  • Heavily reliant on Aura framework for creation and execution, which is limiting.



Lightening Web Component


#Markup


<template>

  <lightning-card title="HelloWorld" icon-name="custom:custom14">

    <div class="slds-m-around_medium">

      <p>Hello, {greeting}!</p>

      <lightning-input label="Name" value={greeting} onchange={changeHandler}></lightning-input>

    </div>

  </lightning-card>

</template>


#Javascript


import { LightningElement } from 'lwc';

export default class HelloWorld extends LightningElement {

  greeting = 'World';

  changeHandler(event) {

    this.greeting = event.target.value;

  }

}


Lightning Web Components is the Salesforce implementation of that new breed of lightweight frameworks built on web standards. It leverages custom elements, templates, shadow DOM, decorators, modules, and other new language constructs available in ECMAScript 7 and beyond.


  • Like ReactJs Lwc is a component based development programming tool provided by Salesforce.



Lightening Design System


The Salesforce Lightning Design System includes the resources to create user interfaces consistent with the Salesforce Lightning principles, design language, and best practices. Rather than focusing on pixels, developers can focus on application logic, while designers can focus on user experience, interactions, and flows.


Link -> https://www.lightningdesignsystem.com/getting-started/


SOQL


To read a record from Salesforce, you must write a query. Salesforce provides the Salesforce Object Query Language, or SOQL in short, that you can use to read saved records.


Account[] accts = [SELECT Name,Phone FROM Account WHERE (Name='SFDC Computing' AND NumberOfEmployees>25)ORDER BY Name LIMIT 10];


System.debug(accts.size() + ' account(s) returned.');



SOSL


Use SOSL to search fields across multiple standard and custom object records in Salesforce.


List<List<SObject>> searchList = [FIND 'SFDC' IN ALL FIELDS 

                                      RETURNING Account(Name), Contact(FirstName,LastName)];


SOQL vs SOSL


  • Use SOQL to retrieve records for a single object.

  • Use SOSL to search fields across multiple objects. SOSL queries can search most text fields on an object.

Another difference is that SOSL matches fields based on a word match while SOQL performs an exact match by default (when not using wildcards). For example, searching for 'Digital' in SOSL returns records whose field values are 'Digital' or 'The Digital Company', but SOQL returns only records with field values of 'Digital'.



Workbench


Workbench is a suite of tools for interacting with your Salesforce org through the API. 


  • make REST API calls from the REST explorer

  • create an account using the SObject resource and the POST method

  • Execute a Query


Link ->

https://trailhead.salesforce.com/content/learn/modules/api_basics/api_basics_rest



DML


Create and modify records in Salesforce by using the Data Manipulation Language, abbreviated as DML. DML provides a straightforward way to manage records by providing simple statements to insert, update, merge, delete, and restore records.


// Create the account sObject 

Account acct = new Account(Name='Acme', Phone='(415)555-1212', NumberOfEmployees=100);

// Insert the account by using DML

insert acct;


Link->https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_dml



Apex Test Classes


public class TemperatureConverter {

    // Takes a Fahrenheit temperature and returns the Celsius equivalent.

    public static Decimal FahrenheitToCelsius(Decimal fh) {

        Decimal cs = (fh - 32) * 5/9;

        return cs.setScale(2);

    }

}


TestClass


The Apex testing framework enables you to write and execute tests for your Apex classes and triggers on the Lightning Platform. Apex unit tests ensure high quality for your Apex code and let you meet requirements for deploying Apex.


@isTest

private class TemperatureConverterTest {

    @isTest static void testWarmTemp() {

        Decimal celsius = TemperatureConverter.FahrenheitToCelsius(70);

        System.assertEquals(21.11,celsius);

    }

}



Approval Processes


An approval process automates how Salesforce records are approved in your org. In an approval process, you specify:

  • The steps necessary for a record to be approved and who approves it at each step. For example, when an employee creates a time-off request, have Salesforce automatically send an approval request to the employee’s manager.

  • The actions to take based on what happens during the approval process. For example, if a time-off request is approved, update fields on the employee’s record. But if the request is rejected, send a notification to the employee.



Reports



A report is a list of records that meet the criteria you define. It’s displayed in Salesforce in rows and columns, and can be filtered, grouped, or displayed in a graphical chart.


  1. Go to the Reports tab and click on New Report .

  2. Select the ‘Accounts’ report type and click Create.

  3. In the filters pane, click Add and select Field Filter.

  4. Choose a field from the first drop-down list. For this example, let’s choose Type.

  5. Set the filter operator to Equals.

  6. Click the lookup icon next to the third field, select the value Customer - Direct , and click OK.

  7. For the Date Field, select Created Date and set the range to All Time.

Shows all of your Accounts where the Type = Customer - Direct. 




Dashboards


Salesforce dashboards allow you to present multiple reports side-by-side using dashboard components on a single dashboard page layout. 


  1. Click the Reports tab.

  2. Click New Dashboard.

  3. From the Components tab, drag and drop the pie chart component onto the preview pane.

  4. Click the Data Sources tab.

  5. Search for your leads by Lead Source report and drag and drop it onto the pie chart component.

  6. Give the chart a moment to generate. Once it generates, click in the Edit Header section and type in Leads by Lead Source.

  7. Customize and Save



Data Loader and Import Wizard


Data Import Wizard—this tool, accessible through the Setup menu, lets you import data in common standard objects, such as contacts, leads, accounts, as well as data in custom objects. It can import up to 50,000 records at a time.


Data Loader—this is a client application that can import up to five million records at a time, of any data type, either from files or a database connection.


Steps in Link Below →


https://trailhead.salesforce.com/content/learn/modules/lex_implementation_data_management/lex_implementation_data_import


Salesforce Data Security


The platform makes it easy to specify which users can view, create, edit, or delete any record or field in the app. You can control access to your whole org, a specific object, a specific field, or even an individual record.


  • Through object-level security, we can stop the user from viewing, deleting, adding a particular object.

  • Using Field Level Security administrator can controls whether a user can see, edit, and delete the value for a particular field on an object. 

  • Record level security enables users to access a few object records.


Apex CallOuts


Http http = new Http();

HttpRequest request = new HttpRequest();

request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals');

request.setMethod('GET');

HttpResponse response = http.send(request);

// If the request is successful, parse the JSON response.

if (response.getStatusCode() == 200) {

    // Deserialize the JSON string into collections of primitive data types.

    Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());

    // Cast the values in the 'animals' key as a list

    List<Object> animals = (List<Object>) results.get('animals');

    System.debug('Received the following animals:');

    for (Object animal: animals) {

        System.debug(animal);

    }

}


Logs → The names of the animals are displayed.


An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending a HTTP request from Apex code and then receiving the response.


GET - Retrieve data identified by a URL.

POST - Create a resource or post data to the server.

DELETE - Delete a resource identified by a URL.

PUT - Create or replace the resource sent in the request body.


Link -> https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_rest_callouts



Integration


Salesforce connects to Apps using Connectors like,


  • To Heroku using Heroku Connect

  • To Marketing Cloud using Marketing Cloud Connector


Or with features like, 


  • To Apps and Websites Using Apex Callouts

  • Web to Lead

  • APIs




Public Groups and Sharing Rules


Before creating a sharing rule, it’s important to set up the appropriate public group. A public group is a collection of individual users, other groups, individual roles or territories, and/or roles or territories with their subordinates that all have a function in common. Sharing rules are used to extend sharing access to users in public groups or roles. You can assign either Read-Only or Read/Write access.



Sandbox and Production


Sandbox is a copy of your production organization. You can create multiple copies of your organization in separate environments for different purposes such as development, testing and training, without compromising the data and applications in your production organization.


Every organization using Salesforce has a production or “live” org and a set of sandboxes. Developers employ the production organization, which has live data. Salesforce Sandboxes are replicas of the production org.


Change Sets


Use change sets to send customizations from one Salesforce org to another. For example, you can create and test a new object in a sandbox org, then send it to your production org using a change set. This change set contains any new and changed metadata components.


Deployment


Link →

https://trailhead.salesforce.com/content/learn/modules/declarative-change-set-development/develop-and-test-changes-locally


1. Create an Outbound Change Set

2. Authorize a Deployment Connection

3. Upload the Change Set




Comments

Popular posts from this blog

Remote Developer Job Sites

Remote Developer Job Sites 1.  https://angel.co/ 2.  https://turing.com/ 3.  https://www.employremotely.com/ 4.  https://www.upwork.com/ 5.  https://www.freelancer.com/ 6.  https://www.pesto.tech/ 7.  https://www.guru.com/ 8.  https://www.fiverr.com/ 9.  https://remotive.io/ 10. Search Remote Jobs on LinkedIn or other such platforms. 11. Sell Code on  https://codecanyon.net/ Lastly, a viable option could be, you can open your own website, display your work and get your own set of clients.

Salesforce Marketing Cloud Tutorial

  Salesforce Marketing Cloud Corporate Training. Salesforce Deck www.royalsdeck.com What is SFMC ? SFMC is a platform to engage with Customers across every channel: email, social, web, and mobile. Automate and manage every campaign, publish content, analyse results, and optimise as you go. In Short, a tool to engage customers through targeted campaigns and customer journeys. Course Content Email Studio Journey Builder Automation Studio Data Extension All Subscribers Profile Center CANSPAM Law Trigger Sends Unsubscription Management Web Studio Dynamic Email Classic Content/Content Builder Ampscript SSJS Synchronised DE Mobile Studio Social Studio Interaction Studio Marketing Cloud Overview Email Studio - an email builder Personalisation Hello %%FirstName%%, <Message Body...> Regards, RoyalsCodeCamp Journey Builder A drag and drop based canvas to create marketing campaigns Automation Studio Automate Scripts, Queries, Email send, Data import etc. Data Extension A Database to store t

Salesforce Marketing Cloud : Ampscript in 10 Minutes

Salesforce Marketing Cloud Ampscript in 10 Minutes Variables %%[ Var @a Set @a = 10 ]%% <h1>%%=v(@a)=%%</h1> Lookup Lookup ( "DENAME" , "EmailAddress" , "SubscriberKey" ,   @lookupValue ) LookupRows set @rows = LookupRows ( "DENAME" , "flag" , true ) set @rowCount = rowcount ( @rows ) if @rowCount > 0 then    for @i = 1 to @rowCount do      var @emailAddress , @firstName , @rank      set @row = row ( @rows , @i )        set @emailAddress = field ( @row , "emailAddress" )     ]%%     <br>emailAddress: %%= v ( @emailAddress ) =%%      %%[  next @i ]%% %%[ else ]%% No rows found %%[ endif ]%% InsertDE This function inserts a row in a Data Extension InsertDE ( "DENAME" , "EmailAddress" ,   @emailAddress , "SubscriberKey" ,   @subscriberKey ) UpdateDE This function updates the Data Extension   UpdateDE ( "DENAME" , 1 , "EmailAddress&qu