100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

APEX WORKBOOK ALL CONTENT WITH COMPLETESOLUTIONS

Rating
-
Sold
-
Pages
87
Grade
A+
Uploaded on
03-09-2023
Written in
2023/2024

Apex Workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Part 1: Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Creating Warehouse Custom Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Using the Developer Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Activating the Developer Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Using the Developer Console to Execute Apex Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Creating Sample Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Creating and Instantiating Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Creating an Apex Class Using the Developer Console . . . . . . . . . . . . . . . . . . . . . . . . . 6 Calling a Class Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Creating an Apex Class Using the Salesforce User Interface . . . . . . . . . . . . . . . . . . . . . 9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Part 2: Apex Language Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Primitive Data Types and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Boolean and Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Time, Date, and Datetime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Integer, Long, Double and Decimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Null Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Enums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Comments, Case Sensitivity, Collections and Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Case Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Arrays and Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Sets and Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Classes, Interfaces and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Defining Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Private Modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Static Variables, Constants, and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Property Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 sObjects and the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 What is an sObject? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 SOQL and SOSL Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Traversing and Querying sObject Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 SOQL For Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Apex Data Manipulation Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 What Is an Exception? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Try, Catch, and Finally Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Built-In Exceptions and Common Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Catching Different Exception Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Creating Custom Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Part 3: Apex in Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Executing Data Operations as a Single Transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Adding Custom Business Logic Using Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Creating a Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Invoking the Trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Apex Unit Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Adding a Test Utility Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Add Test Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Run Tests and Code Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Running Apex Within Governor Execution Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Scheduled Execution of Apex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Adding a Class that Implements the Schedulable Interface . . . . . . . . . . . . . . . . . . . . . 58 Adding a Test for the Schedulable Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Scheduling and Monitoring Scheduled Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Apex Batch Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Adding a Batch Apex Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Adding a Test for the Batch Apex Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Running a Batch Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Apex REST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Add a Class as a REST Resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Creating a Record Using the Apex REST POST Method . . . . . . . . . . . . . . . . . . . . . . . . . 68 Retrieving a Record Using the Apex REST GET Method . . . . . . . . . . . . . . . . . . . . . . . . . 69 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Visualforce Pages with Apex Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Enabling Visualforce Development Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Contents Creating a Simple Visualforce Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Displaying Product Data in a Visualforce Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 Using a Custom Apex Controller with a Visualforce Page . . . . . . . . . . . . . . . . . . . . . . 75 Using Inner Classes in an Apex Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Adding Action Methods to an Apex Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Contents APEX WORKBOOK FApex is a strongly-typed, object-oriented programming language that allows you to write code that executes on the F platform. Out of the box, F provides a lot of high-level services, such as Web services, scheduling of code execution, batch processing, and triggers—all of which require you to write Apex. About the Apex Workbook This workbook provides an introduction to both the Apex programming language, as well as the contexts in which you can use Apex—such as triggers. This workbook does assume you know a little about programming. If you don’t, you’ll still manage to follow along, but it will be a little more difficult. We recommend Head First Java to start learning about programming. Although the book is about Java, Java is quite similar to Apex in many ways, and it will provide the foundation you need. The workbook is organized into three chapters: • Part 1: Orientation shows you the basics: how to create a simple Apex class, and how to use the Developer Console to execute Apex snippets. • Part 2: Apex Language Fundamentals looks at the syntax, type system, and database integration found in the Apex language. • Part 3: Apex in Context looks at how to use Apex to write triggers, unit tests, scheduled Apex, batch Apex, REST Web services, and Visualforce controllers. The goal is to give you a tour of Apex, not build a working application. While touring along, feel free to experiment. Change the code a little, substitute a different component—have fun! Intended Audience This workbook is intended for developers new to the F platform who want an introduction to Apex development on the platform, and for Salesforce admins who want to delve more deeply into app development using coding. If you’re an admin just getting started with F, see the F Platform Fundamentals for an introduction to point-and-click app development. Supported Browsers Microsoft Edge Salesforce supports Microsoft Edge on Windows 10 for Salesforce Classic. Note these restrictions. • The HTML solution editor in Microsoft Edge isn’t supported in Salesforce Knowledge. • Microsoft Edge isn’t supported for the Developer Console. • Microsoft Edge isn’t supported for Salesforce CRM Call Center built with CTI Toolkit version 4.0 or higher. Before You Begin You’ll need a F environment that supports F development. Th

Show more Read less











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
September 3, 2023
Number of pages
87
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Classroom NURSING
View profile
Follow You need to be logged in order to follow users or courses
Sold
4674
Member since
3 year
Number of followers
3217
Documents
51892
Last sold
2 hours ago
NURSING

Assignments, Case Studies, Research, Essay writing service, Questions and Answers, Discussions etc. for students who want to see results twice as fast. I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules. For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!!!!!!!!!!!

Read more Read less
4.0

1152 reviews

5
606
4
213
3
187
2
38
1
108

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions