Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Force.com Application Development

You're reading from   Learning Force.com Application Development Use the Force.com platform to design and develop real-world, cutting-edge cloud applications

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781782172796
Length 406 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Chamil Madusanka Chamil Madusanka
Author Profile Icon Chamil Madusanka
Chamil Madusanka
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Getting Started with Force.com FREE CHAPTER 2. Building the Data Model 3. Building the User Interface 4. Designing Apps for Multiple Users and Protecting Data 5. Implementing Business Processes 6. Data Management on the Force.com Platform 7. Custom Coding with Apex 8. Building Custom Pages with Visualforce 9. Analytics as a Service with the Force.com Platform 10. E-mail Services with the Force.com Platform 11. Building Public Websites with Force.com Sites 12. Deploying the Force.com Application A. Force.com Tools Index

Triggers


As you learned in the previous section, Apex code can be used to write classes or triggers. A trigger is an Apex script that executes when a data manipulation language (DML) event occurs on a specific sObject. Therefore, triggers are directly bound with the records of a particular sObject. If the particular record is affected, then the related trigger will be executed:

  • The record is accessed via the standard page or Visualforce page

  • The record is accessed via a web services API

Triggers can be created on any custom or top-level standard object. There are four types of DML events that affect a trigger of a particular object:

  1. Insert

  2. Update

  3. Delete

  4. Undelete

The preceding DML events can be executed either before or after the event. You can specify that in the trigger defining:

  • before: Before triggers can update variable values before they are saved to the database.

  • after: After triggers can access field values that are set automatically (such as ID or last updated fields) or to affect changes...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime