Book Image

Salesforce CRM Admin Cookbook - Second Edition

By : Paul Goodey
Book Image

Salesforce CRM Admin Cookbook - Second Edition

By: Paul Goodey

Overview of this book

Salesforce CRM is a market-leading customer relationship management (CRM) application that is accessed over the internet. This application greatly enhances a company's sales performance, improves customer satisfaction, and provides a robust customer relationship management system for an organization. Salesforce CRM Admin Cookbook, Second Edition enables you to instantly extend and unleash the power of Salesforce CRM and its Lightning Experience framework. It provides clear, comprehensive instructions along with detailed screenshots and code. Whether you are looking for solutions to enhance the core features, such as data management, process automation, data validation, and home page administration, or are looking for ideas on advanced customization techniques, this book will provide you with immediate, practical, and exciting real-world recipes. This book guides you through interesting topics spanning a variety of functional areas. Recipes are provided that allow you to configure, build and extend the capability of Salesforce CRM using the Lightning Experience framework.
Table of Contents (16 chapters)
Title Page
Credits
About the Author
Acknowledgements
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Composing an Apex Test Class


Before we can deploy the Apex Controller class AccountSearchController, which we created in the Developing an Apex Controller to search for accounts recipe, to the production environment, at least 75% of the Apex code must be covered by unit tests, and all of those tests must complete successfully.

Writing unit tests for Apex code is a necessary activity when developing code in the Salesforce platform, and a mandatory requirement before you are able to deploy the code into a Salesforce production environment.

The purpose of the unit tests is to ensure that 75% of the lines of code, as a minimum, have been covered by the unit tests. You should, however, strive to write unit tests that cover every logical path of your code, including any error handling, to achieve 100% code coverage.

How to do it...

Carry out the following steps to create an Apex test class, that provides unit test coverage for our Apex Controller, using the Salesforce Developer Console:

  1. Click on the...