Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Apex Programming
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Apex Programming

Mastering Apex Programming - Second Edition

By : Paul Battisson
4 (1)
close
close
Mastering Apex Programming

Mastering Apex Programming

4 (1)
By: Paul Battisson

Overview of this book

Applications built on the Salesforce platform are now a key part of many organizations' IT systems, with more complex and integrated solutions being delivered every day. As a Salesforce developer working with Apex, it is important to understand the range and variety of tools at your disposal, how and when to use them, and what the best practices are. This revised second edition includes a complete restructuring and five new chapters filled with detailed content on the latest Salesforce innovations including integrating with DataWeave in Apex, and utilizing Flow and Apex together to build scalable applications with Administrators. This Salesforce book starts with a discussion around common mistakes, debugging, exception handling, and testing. The second section focuses on the different asynchronous Apex programming options to help you build more scalable applications, before the third section focuses on integrations, including working with platform events and developing custom Apex REST web services. Finally, the book finishes with a section dedicated to profiling and improving the performance of your Apex including architecture. With code examples used to facilitate discussion throughout, by the end of the book you will be able to develop robust and scalable applications in Apex with confidence.
Table of Contents (28 chapters)
close
close
1
Section 1: Triggers, Testing, and Security
8
Section 2: Asynchronous Apex
13
Section 3: Integrations
21
Section 4: Apex Performance

Testing endpoints using Workbench

In Chapter 12, Using Platform Events, we saw how we can publish platform events through the Salesforce REST API using the Workbench tool at https://workbench.developerforce.com/restExplorer.php. When we define a new Apex REST API, we can access and test the API using the same REST Explorer tool.

Any custom Apex REST endpoint is exposed through the /services/apexrest/yourURLMapping endpoint. For our hospital endpoint, this is /services/apexrest/hospital.

In the following screenshot, you can see how I have entered this URL with the ACME123 resource identifier, and run a GET request to retrieve the hospital record with Hospital_Ref_Code__c set to ACME123:

Figure 14.4 – Running a GET request against a custom endpoint using the Workbench REST Explorer

Figure 14.4 – Running a GET request against a custom endpoint using the Workbench REST Explorer

You can see in the screenshot that the REST Explorer formats the response from the API. However, you can click the Show Raw Response link and the raw response from...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Apex Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon