SlideShare a Scribd company logo
1 of 16
Rinku Saini
When Developer writes and save code in platform , Which is
compiled on force.com platform and store in the form of
metadata in the salesforce server. End users can send request
from UI and retrieve result from salesforce server.
Working of Apex-
Apex Code: Logic-as-a-Service
 What is it?
 What can it do?
 How do I use it?
 Well, let’s see it!
Introducing Apex
 Force.com allows many customizations through User
Interface
 Force.com API allows developers to write client-side
programs or integrations for more flexibility in their
applications
 Client side programs have performance costs
 Lack transactional control across API requests
 Cost and complexity of client hosting server code
 APEX was introduced to address those issues and to
revolutionize the way developers create on-demand
applications.
Apex Code Is
 Strongly-typed, object-based programming language
 Enables developers to execute logic and transaction
control statements on Force.com
 Runs natively on the server
 Code executes on the server when initiated by User
Interface via Buttons & Events, and data through the
API
 Java or C#-like syntax
 Transactional
How is Apex Different?
 Executes directly on the Force.com
 Eliminates network traffic between client application and
Force.com
 Apex Code tightly integrated to the rest of the platform
functionality
 Changes to the metadata referenced in Apex Code will
cause an automatic recompilation the next time those
components are executed
Language Basics
Data Types – Primitive
- String
- Boolean
- Date and DateTime
- Integer, Long, Double
- ID (Force.com database record identifier)
- Blob (for storing binary data)
- Sobject (object representing a Force.com standard or custom
object)
Example:
DateTime dt = System.now() + 1;
Boolean isClosed = true;
String sCapsFirstName = ‘Andrew’.toUpperCase();
Account acct = new Account(); //Sobject example
Language Basics (cont)
Data Types – Collections
Lists - A list can contain duplicate elements.
Sets - A Set is a Collection that cannot contain duplicate elements
Maps – A Map is a pair of key and value.
Arrays - fixed-size sequential collection of elements of the same
type.
Example:
List<Integer> myList = new List<Integer>();
myList.add(12); //Add the number 12 to the list
myList.get(0); //Access to first integer stored in the List
Force.com Query Languages
 SOQL – Salesforce object Query Language
String myName = ‘Acme’;
Account[] accts = [SELECT ID FROM Account WHERE name =:myName] //Pass in a variable
 SOSL – Salesforce object Search Language
List<List<SObject>> searchList = [FIND '415' IN PHONE FIELDS RETURNING Account, Contact ];
Account [] accounts = ((List<Account>)searchList[0]);
Contact [] contacts = ((List<Contact>)searchList[1]);
Data Manipulation with Apex
 DML (Data Manipulation Language)
- Insert
- Update
- Upsert - Operation to create a new or update existing record
based on an external id.
- Delete
- Undelete
Apex Triggers-
 Syntex of writing trigger-
trigger TriggerName on ObjectName (trigger_events) {
code_block
}
 Rules to write trigger-
 It starts with the keyword trigger.
 A unique trigger name to differentiate it from the other triggers.
 Multiple trigger can be defined on the same database object.
 You must name the database object on which to create the trigger.
 You can create trigger on custom and standard objects.
 A comma separated list of one or more trigger events that cause the trigger code to be
executed.
 A event is specified using two keywords 1st one is either before or after. These
indicate that the trigger is going to be executed before or after the database operation
is saved.
 The 2nd keyword is the DML operation - insert, update, delete or undelete.
Apex Class-
 Defination- Class is the collection of data member and
member method.
 Syntex of Class-
 Public class CustomClass{
 Public CustomClass(){} //constructor
 }
 Access Specifiers-
 Private
 Protected
 Public
 global
Difference between Class And Triggers
 Class-
 An Apex class is a template or blueprint from which Apex objects
are created.
 Classes consist of other classes, user-defined methods, variables,
exception types.
 Triggers-
 A trigger is Apex code that executes before or after specific data
manipulation language (DML) events occur, such as before object
records are inserted into the database, or after records have been
deleted.
 A trigger is associated with a standard or custom object and can call
methods of Apex classes
VisualForce -MVC
MVC Meaning-
 Model - includes the custom and standard objects.
 View - is defined by VF pages.
 Visualforce Page - are the salesforce created pages. That is
a markup language.
 Controller - includes the standard,custom, extension
classes.
 That are also known as - Standard controller, custom
controller and extension controller.
Thank You!!

More Related Content

What's hot

SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developersllangit
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldevllangit
 
Understanding C# in .NET
Understanding C# in .NETUnderstanding C# in .NET
Understanding C# in .NETmentorrbuddy
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12Sisir Ghosh
 
Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Mohamed Saleh
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)David McCarter
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And XmlDavid Truxall
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshStrawhatLuffy11
 
Introduction To NHibernate
Introduction To NHibernateIntroduction To NHibernate
Introduction To NHibernateEmad Alashi
 
Language Integrated Query - LINQ
Language Integrated Query - LINQLanguage Integrated Query - LINQ
Language Integrated Query - LINQDoncho Minkov
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overviewpradeepkothiyal
 
Annotation Sniffer Hotspots implementation
Annotation Sniffer Hotspots implementationAnnotation Sniffer Hotspots implementation
Annotation Sniffer Hotspots implementationHélio Costa e Silva
 

What's hot (19)

SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
 
Understanding C# in .NET
Understanding C# in .NETUnderstanding C# in .NET
Understanding C# in .NET
 
ASP.NET Session 11 12
ASP.NET Session 11 12ASP.NET Session 11 12
ASP.NET Session 11 12
 
Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)
 
Linq to sql
Linq to sqlLinq to sql
Linq to sql
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
NHibernate
NHibernateNHibernate
NHibernate
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
 
Ado.net
Ado.netAdo.net
Ado.net
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - Ashutosh
 
Ef code first
Ef code firstEf code first
Ef code first
 
Introduction To NHibernate
Introduction To NHibernateIntroduction To NHibernate
Introduction To NHibernate
 
Dataweave nagarjuna
Dataweave nagarjunaDataweave nagarjuna
Dataweave nagarjuna
 
Language Integrated Query - LINQ
Language Integrated Query - LINQLanguage Integrated Query - LINQ
Language Integrated Query - LINQ
 
Linq in C# 3.0: An Overview
Linq in C# 3.0: An OverviewLinq in C# 3.0: An Overview
Linq in C# 3.0: An Overview
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Introduction to Oracle
Introduction to OracleIntroduction to Oracle
Introduction to Oracle
 
Annotation Sniffer Hotspots implementation
Annotation Sniffer Hotspots implementationAnnotation Sniffer Hotspots implementation
Annotation Sniffer Hotspots implementation
 

Viewers also liked

Affordable Workflow Options for APEX
Affordable Workflow Options for APEXAffordable Workflow Options for APEX
Affordable Workflow Options for APEXNiels de Bruijn
 
Apex for Admins: Beyond the Basics (Part 2)
Apex for Admins: Beyond the Basics (Part 2) Apex for Admins: Beyond the Basics (Part 2)
Apex for Admins: Beyond the Basics (Part 2) Salesforce Developers
 
Apex and design pattern
Apex and design patternApex and design pattern
Apex and design patternRosario Renga
 
SFDC - Step by Step Reference Guide
SFDC - Step by Step Reference GuideSFDC - Step by Step Reference Guide
SFDC - Step by Step Reference GuideKelsea Kiene
 
Apex basics-for Beginners
Apex basics-for BeginnersApex basics-for Beginners
Apex basics-for Beginnershrakhra
 
Introduction to Apache Apex by Thomas Weise
Introduction to Apache Apex by Thomas WeiseIntroduction to Apache Apex by Thomas Weise
Introduction to Apache Apex by Thomas WeiseBig Data Spain
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?Oliver Lemm
 
Process builder vs Triggers
Process builder vs TriggersProcess builder vs Triggers
Process builder vs TriggersProQuest
 

Viewers also liked (12)

Apex institutions
Apex institutionsApex institutions
Apex institutions
 
Oracle Day 2014 - Mobile Customer Case - PROMIS Lite, or How Oracle MAF mobil...
Oracle Day 2014 - Mobile Customer Case - PROMIS Lite, or How Oracle MAF mobil...Oracle Day 2014 - Mobile Customer Case - PROMIS Lite, or How Oracle MAF mobil...
Oracle Day 2014 - Mobile Customer Case - PROMIS Lite, or How Oracle MAF mobil...
 
Affordable Workflow Options for APEX
Affordable Workflow Options for APEXAffordable Workflow Options for APEX
Affordable Workflow Options for APEX
 
Apex for Admins: Beyond the Basics (Part 2)
Apex for Admins: Beyond the Basics (Part 2) Apex for Admins: Beyond the Basics (Part 2)
Apex for Admins: Beyond the Basics (Part 2)
 
Apex and design pattern
Apex and design patternApex and design pattern
Apex and design pattern
 
SFDC - Step by Step Reference Guide
SFDC - Step by Step Reference GuideSFDC - Step by Step Reference Guide
SFDC - Step by Step Reference Guide
 
Apex basics-for Beginners
Apex basics-for BeginnersApex basics-for Beginners
Apex basics-for Beginners
 
Introduction to Apache Apex by Thomas Weise
Introduction to Apache Apex by Thomas WeiseIntroduction to Apache Apex by Thomas Weise
Introduction to Apache Apex by Thomas Weise
 
Resource mobilization
Resource mobilizationResource mobilization
Resource mobilization
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?
 
Funds Mobilization
Funds MobilizationFunds Mobilization
Funds Mobilization
 
Process builder vs Triggers
Process builder vs TriggersProcess builder vs Triggers
Process builder vs Triggers
 

Similar to Introduction to apex

Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg frameworkYousuf Roushan
 
Preethi apex-basics-jan19
Preethi apex-basics-jan19Preethi apex-basics-jan19
Preethi apex-basics-jan19Preethi Harris
 
Introduction to apex code
Introduction to apex codeIntroduction to apex code
Introduction to apex codeEdwinOstos
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfoliomwillmer
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Igor Moochnick
 
Ty bca-sem-v-introduction to vb.net-i-uploaded
Ty bca-sem-v-introduction to vb.net-i-uploadedTy bca-sem-v-introduction to vb.net-i-uploaded
Ty bca-sem-v-introduction to vb.net-i-uploadedPrachi Sasankar
 
Salesforce Basic Development
Salesforce Basic DevelopmentSalesforce Basic Development
Salesforce Basic DevelopmentNaveen Dhanaraj
 
Enterprise Library 2.0
Enterprise Library 2.0Enterprise Library 2.0
Enterprise Library 2.0Raju Permandla
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworksbrendonschwartz
 
Introduction to c_plus_plus
Introduction to c_plus_plusIntroduction to c_plus_plus
Introduction to c_plus_plusSayed Ahmed
 
Introduction to c_plus_plus (6)
Introduction to c_plus_plus (6)Introduction to c_plus_plus (6)
Introduction to c_plus_plus (6)Sayed Ahmed
 
LDAP Injection & Blind LDAP Injection
LDAP Injection & Blind LDAP InjectionLDAP Injection & Blind LDAP Injection
LDAP Injection & Blind LDAP InjectionChema Alonso
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0Abhishek Sur
 

Similar to Introduction to apex (20)

Salesforce
SalesforceSalesforce
Salesforce
 
SetFocus Portfolio
SetFocus PortfolioSetFocus Portfolio
SetFocus Portfolio
 
Development withforce
Development withforceDevelopment withforce
Development withforce
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 
Preethi apex-basics-jan19
Preethi apex-basics-jan19Preethi apex-basics-jan19
Preethi apex-basics-jan19
 
Introduction to apex code
Introduction to apex codeIntroduction to apex code
Introduction to apex code
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
Ty bca-sem-v-introduction to vb.net-i-uploaded
Ty bca-sem-v-introduction to vb.net-i-uploadedTy bca-sem-v-introduction to vb.net-i-uploaded
Ty bca-sem-v-introduction to vb.net-i-uploaded
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
 
Salesforce Basic Development
Salesforce Basic DevelopmentSalesforce Basic Development
Salesforce Basic Development
 
unit 3.docx
unit 3.docxunit 3.docx
unit 3.docx
 
Enterprise Library 2.0
Enterprise Library 2.0Enterprise Library 2.0
Enterprise Library 2.0
 
Entity framework1
Entity framework1Entity framework1
Entity framework1
 
Building social and RESTful frameworks
Building social and RESTful frameworksBuilding social and RESTful frameworks
Building social and RESTful frameworks
 
Introduction to c_plus_plus
Introduction to c_plus_plusIntroduction to c_plus_plus
Introduction to c_plus_plus
 
Introduction to c_plus_plus (6)
Introduction to c_plus_plus (6)Introduction to c_plus_plus (6)
Introduction to c_plus_plus (6)
 
LDAP Injection & Blind LDAP Injection
LDAP Injection & Blind LDAP InjectionLDAP Injection & Blind LDAP Injection
LDAP Injection & Blind LDAP Injection
 
Entity framework 4.0
Entity framework 4.0Entity framework 4.0
Entity framework 4.0
 

Recently uploaded

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 

Recently uploaded (20)

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 

Introduction to apex

  • 2. When Developer writes and save code in platform , Which is compiled on force.com platform and store in the form of metadata in the salesforce server. End users can send request from UI and retrieve result from salesforce server. Working of Apex-
  • 3. Apex Code: Logic-as-a-Service  What is it?  What can it do?  How do I use it?  Well, let’s see it!
  • 4. Introducing Apex  Force.com allows many customizations through User Interface  Force.com API allows developers to write client-side programs or integrations for more flexibility in their applications  Client side programs have performance costs  Lack transactional control across API requests  Cost and complexity of client hosting server code  APEX was introduced to address those issues and to revolutionize the way developers create on-demand applications.
  • 5. Apex Code Is  Strongly-typed, object-based programming language  Enables developers to execute logic and transaction control statements on Force.com  Runs natively on the server  Code executes on the server when initiated by User Interface via Buttons & Events, and data through the API  Java or C#-like syntax  Transactional
  • 6. How is Apex Different?  Executes directly on the Force.com  Eliminates network traffic between client application and Force.com  Apex Code tightly integrated to the rest of the platform functionality  Changes to the metadata referenced in Apex Code will cause an automatic recompilation the next time those components are executed
  • 7. Language Basics Data Types – Primitive - String - Boolean - Date and DateTime - Integer, Long, Double - ID (Force.com database record identifier) - Blob (for storing binary data) - Sobject (object representing a Force.com standard or custom object) Example: DateTime dt = System.now() + 1; Boolean isClosed = true; String sCapsFirstName = ‘Andrew’.toUpperCase(); Account acct = new Account(); //Sobject example
  • 8. Language Basics (cont) Data Types – Collections Lists - A list can contain duplicate elements. Sets - A Set is a Collection that cannot contain duplicate elements Maps – A Map is a pair of key and value. Arrays - fixed-size sequential collection of elements of the same type. Example: List<Integer> myList = new List<Integer>(); myList.add(12); //Add the number 12 to the list myList.get(0); //Access to first integer stored in the List
  • 9. Force.com Query Languages  SOQL – Salesforce object Query Language String myName = ‘Acme’; Account[] accts = [SELECT ID FROM Account WHERE name =:myName] //Pass in a variable  SOSL – Salesforce object Search Language List<List<SObject>> searchList = [FIND '415' IN PHONE FIELDS RETURNING Account, Contact ]; Account [] accounts = ((List<Account>)searchList[0]); Contact [] contacts = ((List<Contact>)searchList[1]);
  • 10. Data Manipulation with Apex  DML (Data Manipulation Language) - Insert - Update - Upsert - Operation to create a new or update existing record based on an external id. - Delete - Undelete
  • 11. Apex Triggers-  Syntex of writing trigger- trigger TriggerName on ObjectName (trigger_events) { code_block }  Rules to write trigger-  It starts with the keyword trigger.  A unique trigger name to differentiate it from the other triggers.  Multiple trigger can be defined on the same database object.  You must name the database object on which to create the trigger.  You can create trigger on custom and standard objects.  A comma separated list of one or more trigger events that cause the trigger code to be executed.  A event is specified using two keywords 1st one is either before or after. These indicate that the trigger is going to be executed before or after the database operation is saved.  The 2nd keyword is the DML operation - insert, update, delete or undelete.
  • 12. Apex Class-  Defination- Class is the collection of data member and member method.  Syntex of Class-  Public class CustomClass{  Public CustomClass(){} //constructor  }  Access Specifiers-  Private  Protected  Public  global
  • 13. Difference between Class And Triggers  Class-  An Apex class is a template or blueprint from which Apex objects are created.  Classes consist of other classes, user-defined methods, variables, exception types.  Triggers-  A trigger is Apex code that executes before or after specific data manipulation language (DML) events occur, such as before object records are inserted into the database, or after records have been deleted.  A trigger is associated with a standard or custom object and can call methods of Apex classes
  • 15. MVC Meaning-  Model - includes the custom and standard objects.  View - is defined by VF pages.  Visualforce Page - are the salesforce created pages. That is a markup language.  Controller - includes the standard,custom, extension classes.  That are also known as - Standard controller, custom controller and extension controller.