Descripción:
Dado que las aplicaciones creadas en la plataforma Salesforce son ahora una parte clave de muchas organizaciones, los desarrolladores están cambiando el enfoque a Apex, el lenguaje de programación patentado de Salesforce. Como desarrollador de Salesforce, es importante comprender la gama de herramientas a su disposición, cómo y cuándo usarlas y las mejores prácticas para trabajar con Apex. Dominar la programación de Apex lo ayudará a explorar las funciones avanzadas de la programación de Apex y lo guiará en la entrega de soluciones robustas que escalan.
Objetivo:
Al finalizar el curso el participante:
Comprenderá los errores comunes de codificación en Apex y cómo evitarlos utilizando las mejores prácticas.
Entenderá el proceso de depuración de una aplicación Salesforce Apex de forma eficaz.
Explorará diferentes opciones de Apex asincrónicas y sus casos de uso comunes
Comprenderá los fundamntos para trabajar de forma eficaz con los eventos de la plataforma
Desarrollará servicios REST de Apex personalizados para permitir integraciones entrantes
Creará lógica y procesos complejos en la plataforma Salesforce.
Temario:
Módulo 1 – Fundamentos de APEX
Technical Requirements | APEX Introduction | About the development environment | Delivering programs to SalesForce
Módulo 2 – Common Apex Mistakes
Null Pinter Exceptions | Exceptions on object instances | Exceptions when working with maps | Retrieving configuration data in a bulkified way | Hot and cold data | Bulkification – querying within loops | Hardcoding
Módulo 3 – Debugging Apex
Debugging on Salesforce | Prevention is better than a cure | Log levels | SFDX and streaming logs | Debugging using the Apex Replay Debugger | Apex Interactive Debugger | ISV Customer Debugger | Which tool to use?
Módulo 4 – Triggers and Managing Trigger Execution
The Salesforce order of execution | An example scenario | The save order of execution | Clicks and code | Trigger architecture | Using trigger handler frameworks | Controlling trigger execution |
Módulo 5 – Exceptions and Exception Handling
Understanding the different types of exceptions | Expected exceptions | Unexpected exceptions | Unknown exceptions | Catching errors | Using the finally block | Exception logging | Capturing state | Using custom exception types |
Módulo 6 – Testing Apex Code
Understanding the importance of testing | Using a test data factory to create data | Loading test data using Test.loadData | Testing RESTful web services with static resources | Using Test.startTest and Test.stopTest to demarcate the code under test | Writing a test for any bug that occurs
Módulo 7 – Secure Apex Programming
How permissions and sharing work on Salesforce | Sharing and performance | Enforcing sharing | Sharing records using Apex | Enforcing object and field permissions | Understanding Apex class security | Enforcing permissions and security within SOQL | Avoiding SOQL injection vulnerabilities |
Módulo 8 – Asynchronous Apex and Apex REST
Utilizing Future Methods | When to use a future method | Mixed DML | Other use cases for future methods | Defining future methods | Passing state and coordinating data | Calling future methods | Monitoring execution of future method invocations | Testing future methods
Módulo 9 – Working with Batch Apex
When to use Batch Apex | Large data volumes | Complex logical manipulation processes | High-volume web service callouts | Asynchronous queue processing | Scheduling updates to lots of records | Managed sharing recalculations | A note on testability | Defining a Batch Apex class | The base interface | Stateful batch implementations | Callout-enabled batch classes | Iterable versus QueryLocator in Batch Apex | Invoking Batch Apex Using Database.executeBatch | Scheduling batch classes | Working with a scheduled class and custom metadata | Chaining batches | Executing multiple batches in parallel | Monitoring Batch Apex | Exception handling and platform events | Testing Batch Apex
Módulo 10 – Working with Queueable Apex
What is Queueable Apex? | Queueable versus future | Queueable versus Batch | When to use Queueable Apex | Extensive or complex processes | Callouts | Chained processes | Defining Queueable Apex implementations | Allowing callouts | Invoking Queueable Apex | Enqueuing child/chained jobs | Testing Queueable Apex
Módulo 11 – Scheduling Apex Jobs
When to use Scheduled Apex jobs | One-off executions | Repeating jobs | Defining a schedulable Apex class | Scheduling an Apex class | Using the Apex Scheduler | Using the System.schedule method | System.schedule versus System.scheduleBatch for Batch Apex classes | Suicidal scheduling | Monitoring a scheduled job | Scheduled job limits | Testing scheduled jobs and Apex scheduling |
Módulo 12 – Using Platform Events
An overview of event-driven architecture and the event bus | Exploring event-driven architecture | The event bus | When to use platform events | Asynchronous processes | External connections | Decoupling applications | Defining and publishing a platform event | Using Apex | Using Process Builder to publish events | Publishing platform events through Flow | Using the REST API | Subscribing to and handling platform events | Handling platform events using Apex triggers | Subscribing to platform events in Process Builder | Change Data Capture and platform events | Testing platform events | Testing the consumption of platform events | A discussion of the CometD protocol and handling events externally
Módulo 13 – Apex REST and Custom Web Services
An overview of REST | HTTP methods | REST and Apex – when to use custom endpoints | Replacing a legacy integration | Generic endpoints | Custom logic or complex endpoints | Defining endpoints | Dynamic parsing using custom metadata | Testing endpoints using Workbench | Exposing endpoints | Public APIs and Sites pages | An alternative using URL Rewriter and Visualforce pages | Handling request body data | Handling JSON | Handling XML | Testing Apex REST code |
Módulo 14 – Apex Performance
Performance and the Salesforce Governor Limits | The Salesforce application request lifecycle | Multi-tenancy and performance | Governor limits and why we should embrace them | Thinking about performance
Módulo 15 – Performance Profiling
Measure twice, cut once | The OODA methodology | Observe | Decide | Act | Profiling Apex performance | A utility class to profile Apex | Profiling Lightning Web Components performance |
Módulo 16 – Improving Apex Performance
Improving CPU time | Faster for loops | Using maps to remove and reduce looping | Reducing the use of expensive operations | Reducing heap size usage | Batched for loops | Using scoping | Removing unwanted items | Improving query selectivity | Number of queries | Retrieving child records with a sub query | Cache results | Platform Cache | Understanding when to make some of these improvements
Módulo 17 – Improving Apex Performance
Using clicks with code | Whether to use clicks or code | Clicks, code, and performance implications | Code structure and linting | Object-oriented programming in Apex | Common Salesforce architectural trade-offs | Synchronous versus asynchronous | Wizards to help chunk | Client versus server processing of data | Enterprise patterns versus flexibility | Managing long-term performance of an application