SlideShare a Scribd company logo
SALESFORCE
DEVELOPMENT
- MOUSUMI CHATTERJEE
- NAVEEN DHANARAJ
Agenda
• Introduction
• Apex
• Architecture of Apex
• Collections
• List
• Set
• map
• Query
• SOQL
• SOSL
• Test class
• Visualforce Pages
• Architecture of visualforce pages
Introduction:
Salesforce.com is Sales(CRM) and Service
applications which were developed and
running on the Force.com Platform.
Force.com is a platform where you can
develop your own application
APEX
What is Apex?
• Strongly Typed object oriented programming
language and running on Force.com Platform.
• Apex is Easy to use, Multitenant Environment,
Upgrades Automatically, Easy Testing, Versioned,
Integrated.
• Apex allows developement of business logics to
get executed system events including button
click related record updates and vf pages.
Why we use APEX?
• When we have complex business processes that
are unsupported by the existing functionality.
• When this is the case, the Force.com platform
includes a number of ways for advanced
administrators and developers to implement
custom functionality.
• These include Apex, Visualforce, and the SOAP
API.
Architecture of APEX
Datatype
1.Primitive - Basically found in any other
programming language eg. Boolean, decimal
double , ID (any Id in salesforce .com).
2. sObjects - It refer to Salesforce object .
Datatype very specific to Salesforce. It
represents a row of data.
3.Collections:
sObject
• Account a= new Account(name=“Dw",Type="Customer-Type"
, Industry="Technology");
sObject
• Account a= new Account(name=“Dw",Type="Customer-Type"
, Industry="Technology");
• Account a = new Account( Select name, type, Industry
where name="Dazeworks Technologies);
sObject
Contact c= [Select email from Contact where
name = “Dazeworks"]
String e = c.email;
if(e == null)
delete c;
If Email is not there then record with contact
name will be deleted.
Writing APEX Class
Setup  Build  Develop  Apex Class  New
COLLECTION
Collections
• Collection work somewhat like array, except their
size can change dynamically.
• Collection is an object that can hold reference of
other object or sObject.
• Collection are more advanced in behavior and
have easy access methods .
Types of Collection
•LIST
•SET
•MAP
They are collections used in
APEX.
LIST
• <List> is a collection of records which is
an ordered collection.
• <List> can contain duplicate values.
Example
List<String> animal= new List<String>("pig",
"earthworm", "chimpanzee",
"panda");
• pig--0
• earthworm--1
• chimpanzee -2
• panda ---3
String first_animal =animals.get(0);
It will return pig
SET
• Set is a collection of unique, unordered
primitive datatypes or sobjects.
• Set does not contain duplicate values.
Example
Set<Integer> s = new set<Integer>();
s.add(1); //adds an element to the set
System.asserts(s.contains(1)); // Asserts that
the set contains an element
s.remove(1); removes an element
MAP
• MAP is a collection of key-pair values.
• The key is unique and can be of any data-
type like String , sObjects. Pair-values can
have duplicate values.
SOQL Query
• Salesforce Object Query Language(SOQL) is
a query-only language , similar to SQL .
• It uses relationship for navigating data.
• This is main language used for data retrieval
of a single sObjects.
SOQL Query
SOSL Query
• Salesforce Object Search Language(SOSL)
is a simple language for searching all
multiple persisted objects simultaneously.
• A SOSL Query begins with the required FIND
clause
SOSL Query
Difference B/w SOQL and SOSL
SOQL SOSL
Retrieves the records from the
database by using “SELECT” keyword.
Retrieves the records from the
database by using the “FIND” keyword.
Using SOQL we can know in Which
objects or fields the data resides.
Using SOSL, we don’t know in which
object or field the data resides.
We can retrieve data from single
object or from multiple objects that
are related to each other.
We can retrieve multiple objects and
field values efficiently when the
objects may or may not be related to
each other
We can Query on only one object. We can query on multiple objects.
Total number of records retrieved by
SOQL queries is 50,000
Total number of records retrieved by a
single SOSL query is 2000
TEST CLASS
APEX Unit Test
• There must be 75% test coverage to be able to
deploy apex code to your production organization.
• Testing is key to ensuring the quality of any
application
• Salesforce executes Apex Unit Tests of all
organization to ensure quality and that no existing
behaviour has been altered for customers.
APEX Unit Test
Below is the test class for the APEX Example shown
Best Practice for Test Class
• Test class must start with @isTest annotation.
• To deploy to production at-least 75% code
coverage is required.
• System.debug statement are not counted as a part
of apex code limit.
• Test method should static and no void return type.
• Test method and test classes are not counted as a
part of code limit.
Visualforce Page
Visualforce Page
• Visualforce is a framework that allows
developers to build sophisticated, custom
user interfaces that can be hosted natively
on the Force.com platform.
• Maximum response size for
a Visualforce page is less than 15Mb.
• Maximum file size for a file uploaded using
a Visualforce page is 10Mb.
When to use Visualforce?
Visualforce page is a tag based mark-up
language to develop customised user
interface in Salesforce.
Visualforce Architecture
Writing Visualforce Page
Language style: Tag Mark-up
Page override model: Assemble standard and custom components using
Tags.
Performance
Required technical
Skills:
HTML , XML , Bootstrap
Interaction with Apex Direct, by binding to a custom controller
Example
Example contd…
Tags in Visualforce Page
Tags : Used for :
<apex:page/> Calls an action when the page is loaded.
<apex:Form/> Creates a BUTTON that calls an action .
<apex:pageBlock/> Creates a LINK that calls an action .
<apex:pageblocksection
/>
Create a section within page block.
<apex:inputfield/> HTML input element for a value to a field on a
Salesforce object.
<apex:outputfield/> A read-only display of a label and value for a field on a
Salesforce object
Governor Limits
• Apex runs in a multitenant environment, the Apex
run time engine strictly enforces a number of
limits to ensure that runaway Apex does not
monopolize shared resources.
Description Limits
Total number of SOQL queries issued 100
Total number of SOSL queries issued 20
Total number of DML statements issued 150
Total heap size 6MB
Total heap size for Batch Apex and future
methods
12MB
Maximum size of a Visualforce email
template
1MB
Total number of records retrieved by a
single SOSL query
200
THANK YOU

More Related Content

PPTX
Episode 4 - Introduction to SOQL in Salesforce
PPTX
Introduction to apex code
PDF
Introduction to the Salesforce Security Model
PPTX
Apex code (Salesforce)
PPTX
SOQL in salesforce || Salesforce Object Query Language || Salesforce
PDF
Lwc presentation
PPTX
Introduction to Apex for Developers
PPTX
Introduction to lightning Web Component
Episode 4 - Introduction to SOQL in Salesforce
Introduction to apex code
Introduction to the Salesforce Security Model
Apex code (Salesforce)
SOQL in salesforce || Salesforce Object Query Language || Salesforce
Lwc presentation
Introduction to Apex for Developers
Introduction to lightning Web Component

What's hot (20)

PPTX
Exploring the Salesforce REST API
PPTX
Record sharing model in salesforce
PPTX
Episode 10 - External Services in Salesforce
PPT
Salesforce Presentation
PDF
Salesforce Lightning Process builder
PPTX
Asp.net MVC training session
PDF
An Introduction To PostgreSQL Triggers
PPT
Salesforce REST API
PPTX
Apex Trigger in Salesforce
PPTX
Salesforce Development Best Practices
PPTX
Why Flow with Salesforce Flow
PPTX
Episode 2 conditional flows & loops
PPTX
SOQL & SOSL for Admins
PPT
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
PDF
All About Test Class in #Salesforce
PPT
Oracle Apps - Forms
PDF
Spring aop
PDF
Best Practices with Apex in 2022.pdf
PPTX
Demystify Salesforce Bulk API
Exploring the Salesforce REST API
Record sharing model in salesforce
Episode 10 - External Services in Salesforce
Salesforce Presentation
Salesforce Lightning Process builder
Asp.net MVC training session
An Introduction To PostgreSQL Triggers
Salesforce REST API
Apex Trigger in Salesforce
Salesforce Development Best Practices
Why Flow with Salesforce Flow
Episode 2 conditional flows & loops
SOQL & SOSL for Admins
Salesforce Security Model (Dmitry Goshko, Igor Haritonovich)
All About Test Class in #Salesforce
Oracle Apps - Forms
Spring aop
Best Practices with Apex in 2022.pdf
Demystify Salesforce Bulk API
Ad

Similar to Salesforce Basic Development (20)

PPTX
Sales forcedemo
PPTX
Hands-On Workshop: Introduction to Development on Force.com for Developers
PPTX
Elevate Tel Aviv
PPT
My cool new Slideshow!
PDF
Elevate london dec 2014.pptx
PPTX
Ladies Be Architects - Apex Basics
PPTX
SFDC Database Basics
PPTX
Atl elevate programmatic developer slides
PPTX
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
PPTX
Sales force
PDF
Handling of Large Data by Salesforce
PPTX
SFDC Introduction to Apex
PPTX
Getting a Quick Start with Visualforce
PPTX
Salesforce
PPT
Introduction to Force.com
PPTX
Introduction to apex
PPTX
Saleforce For Domino Dogs
DOCX
Salesforce couse in chennai
DOCX
Salesforce Certification in chennai
DOCX
Salesforce couse Training in chennai
Sales forcedemo
Hands-On Workshop: Introduction to Development on Force.com for Developers
Elevate Tel Aviv
My cool new Slideshow!
Elevate london dec 2014.pptx
Ladies Be Architects - Apex Basics
SFDC Database Basics
Atl elevate programmatic developer slides
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
Sales force
Handling of Large Data by Salesforce
SFDC Introduction to Apex
Getting a Quick Start with Visualforce
Salesforce
Introduction to Force.com
Introduction to apex
Saleforce For Domino Dogs
Salesforce couse in chennai
Salesforce Certification in chennai
Salesforce couse Training in chennai
Ad

Recently uploaded (20)

PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
artificial intelligence overview of it and more
PPTX
innovation process that make everything different.pptx
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
DOCX
Unit-3 cyber security network security of internet system
PPTX
Introduction to Information and Communication Technology
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PDF
Testing WebRTC applications at scale.pdf
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
Decoding a Decade: 10 Years of Applied CTI Discipline
artificial intelligence overview of it and more
innovation process that make everything different.pptx
RPKI Status Update, presented by Makito Lay at IDNOG 10
Sims 4 Historia para lo sims 4 para jugar
SAP Ariba Sourcing PPT for learning material
QR Codes Qr codecodecodecodecocodedecodecode
Design_with_Watersergyerge45hrbgre4top (1).ppt
Slides PPTX World Game (s) Eco Economic Epochs.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
Unit-3 cyber security network security of internet system
Introduction to Information and Communication Technology
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Testing WebRTC applications at scale.pdf
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Tenda Login Guide: Access Your Router in 5 Easy Steps
An introduction to the IFRS (ISSB) Stndards.pdf

Salesforce Basic Development

  • 2. Agenda • Introduction • Apex • Architecture of Apex • Collections • List • Set • map • Query • SOQL • SOSL • Test class • Visualforce Pages • Architecture of visualforce pages
  • 3. Introduction: Salesforce.com is Sales(CRM) and Service applications which were developed and running on the Force.com Platform. Force.com is a platform where you can develop your own application
  • 4. APEX What is Apex? • Strongly Typed object oriented programming language and running on Force.com Platform. • Apex is Easy to use, Multitenant Environment, Upgrades Automatically, Easy Testing, Versioned, Integrated. • Apex allows developement of business logics to get executed system events including button click related record updates and vf pages.
  • 5. Why we use APEX? • When we have complex business processes that are unsupported by the existing functionality. • When this is the case, the Force.com platform includes a number of ways for advanced administrators and developers to implement custom functionality. • These include Apex, Visualforce, and the SOAP API.
  • 7. Datatype 1.Primitive - Basically found in any other programming language eg. Boolean, decimal double , ID (any Id in salesforce .com). 2. sObjects - It refer to Salesforce object . Datatype very specific to Salesforce. It represents a row of data. 3.Collections:
  • 8. sObject • Account a= new Account(name=“Dw",Type="Customer-Type" , Industry="Technology");
  • 9. sObject • Account a= new Account(name=“Dw",Type="Customer-Type" , Industry="Technology"); • Account a = new Account( Select name, type, Industry where name="Dazeworks Technologies);
  • 10. sObject Contact c= [Select email from Contact where name = “Dazeworks"] String e = c.email; if(e == null) delete c; If Email is not there then record with contact name will be deleted.
  • 11. Writing APEX Class Setup  Build  Develop  Apex Class  New
  • 13. Collections • Collection work somewhat like array, except their size can change dynamically. • Collection is an object that can hold reference of other object or sObject. • Collection are more advanced in behavior and have easy access methods .
  • 14. Types of Collection •LIST •SET •MAP They are collections used in APEX.
  • 15. LIST • <List> is a collection of records which is an ordered collection. • <List> can contain duplicate values.
  • 16. Example List<String> animal= new List<String>("pig", "earthworm", "chimpanzee", "panda"); • pig--0 • earthworm--1 • chimpanzee -2 • panda ---3 String first_animal =animals.get(0); It will return pig
  • 17. SET • Set is a collection of unique, unordered primitive datatypes or sobjects. • Set does not contain duplicate values.
  • 18. Example Set<Integer> s = new set<Integer>(); s.add(1); //adds an element to the set System.asserts(s.contains(1)); // Asserts that the set contains an element s.remove(1); removes an element
  • 19. MAP • MAP is a collection of key-pair values. • The key is unique and can be of any data- type like String , sObjects. Pair-values can have duplicate values.
  • 20. SOQL Query • Salesforce Object Query Language(SOQL) is a query-only language , similar to SQL . • It uses relationship for navigating data. • This is main language used for data retrieval of a single sObjects.
  • 22. SOSL Query • Salesforce Object Search Language(SOSL) is a simple language for searching all multiple persisted objects simultaneously. • A SOSL Query begins with the required FIND clause
  • 24. Difference B/w SOQL and SOSL SOQL SOSL Retrieves the records from the database by using “SELECT” keyword. Retrieves the records from the database by using the “FIND” keyword. Using SOQL we can know in Which objects or fields the data resides. Using SOSL, we don’t know in which object or field the data resides. We can retrieve data from single object or from multiple objects that are related to each other. We can retrieve multiple objects and field values efficiently when the objects may or may not be related to each other We can Query on only one object. We can query on multiple objects. Total number of records retrieved by SOQL queries is 50,000 Total number of records retrieved by a single SOSL query is 2000
  • 26. APEX Unit Test • There must be 75% test coverage to be able to deploy apex code to your production organization. • Testing is key to ensuring the quality of any application • Salesforce executes Apex Unit Tests of all organization to ensure quality and that no existing behaviour has been altered for customers.
  • 27. APEX Unit Test Below is the test class for the APEX Example shown
  • 28. Best Practice for Test Class • Test class must start with @isTest annotation. • To deploy to production at-least 75% code coverage is required. • System.debug statement are not counted as a part of apex code limit. • Test method should static and no void return type. • Test method and test classes are not counted as a part of code limit.
  • 30. Visualforce Page • Visualforce is a framework that allows developers to build sophisticated, custom user interfaces that can be hosted natively on the Force.com platform. • Maximum response size for a Visualforce page is less than 15Mb. • Maximum file size for a file uploaded using a Visualforce page is 10Mb.
  • 31. When to use Visualforce? Visualforce page is a tag based mark-up language to develop customised user interface in Salesforce.
  • 33. Writing Visualforce Page Language style: Tag Mark-up Page override model: Assemble standard and custom components using Tags. Performance Required technical Skills: HTML , XML , Bootstrap Interaction with Apex Direct, by binding to a custom controller
  • 36. Tags in Visualforce Page Tags : Used for : <apex:page/> Calls an action when the page is loaded. <apex:Form/> Creates a BUTTON that calls an action . <apex:pageBlock/> Creates a LINK that calls an action . <apex:pageblocksection /> Create a section within page block. <apex:inputfield/> HTML input element for a value to a field on a Salesforce object. <apex:outputfield/> A read-only display of a label and value for a field on a Salesforce object
  • 37. Governor Limits • Apex runs in a multitenant environment, the Apex run time engine strictly enforces a number of limits to ensure that runaway Apex does not monopolize shared resources. Description Limits Total number of SOQL queries issued 100 Total number of SOSL queries issued 20 Total number of DML statements issued 150 Total heap size 6MB Total heap size for Batch Apex and future methods 12MB Maximum size of a Visualforce email template 1MB Total number of records retrieved by a single SOSL query 200