SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
● Who is CodeScience?
● Introduction
● Error handling in ISV Applications
● New In Spring ‘21
● Using these events in packages
● Demo
● Recap
Agenda
This is an image placeholder for an image.
Please size accordingly.
● Founding partner of the Salesforce Product
Development Organization (PDO) Program since
2008 - named Master PDO in 2017
● PDO Program provides app development services
to ISVs for the Salesforce AppExchange
● Partner with clients in various industries to assist
in building over 300 apps on the AppExchange
● From design to build to implementation, we
support through the full lifecycle
Who is CodeScience
Client success: 10% of the AppExchange
CodeScience client focus:
Today’s Speakers:
Rob Davis
Technical Architect
CodeScience
Error Handling In ISV Applications
Why do errors occur?
● We aren’t perfect, sometimes there are coding mistakes
● Subscribers often misconfigure applications. Missing permissions,
credentials, etc.
● Subscribers may build logic, automation, validations, etc that
interfere with the normal function of applications
● Subscriber environments may present unanticipated challenges,
such as 50M+ accounts, hundreds of Process Builders, inefficient
custom code, elaborate sharing models
● Sometimes, errors just happen
Reactive Error Handling
● A subscriber notices some functionality is not working, such as “An
Unexpected Error Has Occurred”, Apex jobs are in error state, data is
not correct, etc.
● They reach out to your customer support with this information, and
you have to help diagnose and fix the issue
● This is time-consuming, costly, and can lead to a loss of trust if it
happens often
Proactive Error Handling
● You attempt to catch errors that you anticipate, and handle them
appropriately
● You attempt to catch anything unexpected, with a few options:
○ Store in a “Log” object with visibility to subscriber, and possible trigger logic
○ Emit an event that can be subscribed to
○ “Phone home” with the information (with explicit subscriber consent)
○ Use FMA FeatureParameterInteger to log error counts
○ Flag “problem” records to exclude from processing
○ Implement a retry mechanism
New in Spring ‘21
New in Spring ‘21
Use BatchApexErrorEvent Triggers to Monitor ISV Applications
● Include BatchApexErrorEvent triggers in your managed package to
monitor the health of batch jobs and take necessary corrective action
without any post-installation steps
● This change applies to Lightning Experience and Salesforce Classic
● The BatchApexErrorEvent object represents a platform event
associated with a failing batch Apex execution
BatchApexErrorEvent
● This is a standard Salesforce event, which can be emitted from Batch
Apex Classes that encounter errors
● This event can be subscribed to just like normal Platform Events, as
well as being able to handle the events with triggers
● It was released in Winter ‘19, but a trigger handler could not be
packaged until Spring ‘21
● It includes information such as job id, error type, record ids being
processed, etc.
● It is triggered on any batch error, including “uncatchable” errors,
such as limit exceptions
Using These Events In Packages
Basic Setup
What Information do you get?
● What job id was running, from which you can get Apex class &
namespace
● The type of exception
● What IDs of the records that were being processed
● The exception message
● The Phase
● The stack trace*** (caveat on next slide)
What are the limitations/concerns?
● No stack trace is available when running from a managed package
● This is a standard event, so you get all subscriber and other package
events as well
● You should limit your error processing to just Apex classes in your
namespace for both data quality & security reasons
● You still don’t get direct access to the error information, and need
consent from your customers to send it to you.
● The JobScope (record ids) is limited to 40k characters (~2100 record
ids and commas), after which point it will be truncated and
DoesExceedJobScopeMaxLength set to true
Demo
In Summary...
● This new Spring ‘21 feature fills in a gap of batch error handling
● This should be used in conjunction with other available
error-handling, such as catching DML errors in the batch and
flagging problem records for follow-up
● You could log this information, subscribe to it, phone home, retry the
batch, flag problematic records, increase error counts in FMA…
● All of these options should increase the resiliency of your solution,
and make debugging issues easier
Contact Us:
Thank You
info@codescience.com
References
● Salesforce Blog Post -
https://developer.salesforce.com/blogs/2019/01/building-a-batch-retry
-framework-with-batchapexerrorevent.html
● Developer documentation -
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/ape
xcode/apex_batch_platformevents.htm
● Technical Documentation -
https://developer.salesforce.com/docs/atlas.en-us.platform_events.me
ta/platform_events/sforce_api_objects_batchapexerrorevent.htm

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
 
“FME Hackathon 2020: Connections” User Judging
“FME Hackathon 2020: Connections” User Judging“FME Hackathon 2020: Connections” User Judging
“FME Hackathon 2020: Connections” User Judging
 
Introduction to Analytics Cloud
Introduction to Analytics CloudIntroduction to Analytics Cloud
Introduction to Analytics Cloud
 
Getting Certified - proven tips for success (French Touch Dreamin)
Getting Certified - proven tips for success (French Touch Dreamin)Getting Certified - proven tips for success (French Touch Dreamin)
Getting Certified - proven tips for success (French Touch Dreamin)
 
Benefits of codeigniter in web development
Benefits of codeigniter in web developmentBenefits of codeigniter in web development
Benefits of codeigniter in web development
 
Api functional monitoring -9th October 2021
Api functional monitoring -9th October 2021Api functional monitoring -9th October 2021
Api functional monitoring -9th October 2021
 
Three Steps for Building an Integrated BPM Application
Three Steps for Building an Integrated BPM ApplicationThree Steps for Building an Integrated BPM Application
Three Steps for Building an Integrated BPM Application
 
Personalized, Powerful, Easy-to-change Business Applications
Personalized, Powerful, Easy-to-change Business ApplicationsPersonalized, Powerful, Easy-to-change Business Applications
Personalized, Powerful, Easy-to-change Business Applications
 
Kochi Mulesoft Meetup #4
Kochi Mulesoft Meetup #4Kochi Mulesoft Meetup #4
Kochi Mulesoft Meetup #4
 
Ordina SOFTC Presentation - SharePoint - Automated scripted deployment
Ordina SOFTC Presentation - SharePoint - Automated scripted deploymentOrdina SOFTC Presentation - SharePoint - Automated scripted deployment
Ordina SOFTC Presentation - SharePoint - Automated scripted deployment
 
#2 connected apps_calicut_31_july
#2 connected apps_calicut_31_july#2 connected apps_calicut_31_july
#2 connected apps_calicut_31_july
 
Process
ProcessProcess
Process
 
Batch Processing with Mule 4
Batch Processing with Mule 4Batch Processing with Mule 4
Batch Processing with Mule 4
 
Helping agencies to build software business
Helping agencies to build software businessHelping agencies to build software business
Helping agencies to build software business
 
Rollup Summary Trigger for Lookup Relationship Salesforce #Salesforce #ApexTr...
Rollup Summary Trigger for Lookup Relationship Salesforce #Salesforce #ApexTr...Rollup Summary Trigger for Lookup Relationship Salesforce #Salesforce #ApexTr...
Rollup Summary Trigger for Lookup Relationship Salesforce #Salesforce #ApexTr...
 
7-SilverlightFireStarter-Toolkit and Controls - Marco Matos
7-SilverlightFireStarter-Toolkit and Controls - Marco Matos7-SilverlightFireStarter-Toolkit and Controls - Marco Matos
7-SilverlightFireStarter-Toolkit and Controls - Marco Matos
 
Meetup bangalore-may22nd2021
Meetup bangalore-may22nd2021Meetup bangalore-may22nd2021
Meetup bangalore-may22nd2021
 
Pixegon Introduction
Pixegon IntroductionPixegon Introduction
Pixegon Introduction
 
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
#1 Calicut MuleSoft Meetup - Introduction to Enterprise Integration and MuleSoft
 

Semelhante a ISV Error Handling With Spring '21 Update

Error management
Error managementError management
Error management
daniil3
 

Semelhante a ISV Error Handling With Spring '21 Update (20)

Dev ops presentation
Dev ops presentationDev ops presentation
Dev ops presentation
 
Retrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architectureRetrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architecture
 
Building of systems of automatic C/C++ code logging
Building of systems of automatic C/C++ code loggingBuilding of systems of automatic C/C++ code logging
Building of systems of automatic C/C++ code logging
 
Code instrumentation
Code instrumentationCode instrumentation
Code instrumentation
 
Apex Replay Debugger and Salesforce Platform Events.pptx
Apex Replay Debugger and Salesforce Platform Events.pptxApex Replay Debugger and Salesforce Platform Events.pptx
Apex Replay Debugger and Salesforce Platform Events.pptx
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
 
Spectacular Specs and how to write them!
Spectacular Specs and how to write them!Spectacular Specs and how to write them!
Spectacular Specs and how to write them!
 
Refactoring ASP.NET and beyond
Refactoring ASP.NET and beyondRefactoring ASP.NET and beyond
Refactoring ASP.NET and beyond
 
Spring batch overivew
Spring batch overivewSpring batch overivew
Spring batch overivew
 
Error management
Error managementError management
Error management
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
 
Workflows via Event driven architecture
Workflows via Event driven architectureWorkflows via Event driven architecture
Workflows via Event driven architecture
 
Architecture presentation 4
Architecture presentation 4Architecture presentation 4
Architecture presentation 4
 
Making Strongly-typed NETCONF Usable
Making Strongly-typed NETCONF UsableMaking Strongly-typed NETCONF Usable
Making Strongly-typed NETCONF Usable
 
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
 
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Observability for Application Developers (1)-1.pptx
Observability for Application Developers (1)-1.pptxObservability for Application Developers (1)-1.pptx
Observability for Application Developers (1)-1.pptx
 
Computer programing 111 lecture 2
Computer programing 111 lecture 2Computer programing 111 lecture 2
Computer programing 111 lecture 2
 
Cp 111 lecture 2
Cp 111 lecture 2Cp 111 lecture 2
Cp 111 lecture 2
 

Mais de CodeScience

Mais de CodeScience (20)

Journey Through the AppExchange: Product-Led Growth with MagicRobot
Journey Through the AppExchange: Product-Led Growth with MagicRobotJourney Through the AppExchange: Product-Led Growth with MagicRobot
Journey Through the AppExchange: Product-Led Growth with MagicRobot
 
Journey Through the AppExchange: From SI to ISV with Virsys12
Journey Through the AppExchange: From SI to ISV with Virsys12Journey Through the AppExchange: From SI to ISV with Virsys12
Journey Through the AppExchange: From SI to ISV with Virsys12
 
Strategic Partnerships: The New Key to Innovation
Strategic Partnerships: The New Key to InnovationStrategic Partnerships: The New Key to Innovation
Strategic Partnerships: The New Key to Innovation
 
Journey Through the AppExchange: How inriver is Filling a Gap for Salesforce ...
Journey Through the AppExchange: How inriver is Filling a Gap for Salesforce ...Journey Through the AppExchange: How inriver is Filling a Gap for Salesforce ...
Journey Through the AppExchange: How inriver is Filling a Gap for Salesforce ...
 
Designing Salesforce Platform Events
Designing Salesforce Platform EventsDesigning Salesforce Platform Events
Designing Salesforce Platform Events
 
Ready, Set, Launch: Accelerating Healthcare Innovation One App at a Time
Ready, Set, Launch: Accelerating Healthcare Innovation One App at a TimeReady, Set, Launch: Accelerating Healthcare Innovation One App at a Time
Ready, Set, Launch: Accelerating Healthcare Innovation One App at a Time
 
Journey Through the AppExchange: How Place Technology Created a New Category
Journey Through the AppExchange: How Place Technology Created a New CategoryJourney Through the AppExchange: How Place Technology Created a New Category
Journey Through the AppExchange: How Place Technology Created a New Category
 
Journey to the AppExchange: How to Launch Into a New Ecosystem
Journey to the AppExchange: How to Launch Into a New EcosystemJourney to the AppExchange: How to Launch Into a New Ecosystem
Journey to the AppExchange: How to Launch Into a New Ecosystem
 
10 Tips to Pass Salesforce Security Review (and Steps to Take If You Don’t!)
10 Tips to Pass Salesforce Security Review (and Steps to Take If You Don’t!)10 Tips to Pass Salesforce Security Review (and Steps to Take If You Don’t!)
10 Tips to Pass Salesforce Security Review (and Steps to Take If You Don’t!)
 
Top 5 Ways to Build Pipeline With AppExchange Chat
Top 5 Ways to Build Pipeline With AppExchange ChatTop 5 Ways to Build Pipeline With AppExchange Chat
Top 5 Ways to Build Pipeline With AppExchange Chat
 
Everything You Need to Know About Salesforce LMA & COA
Everything You Need to Know About Salesforce LMA & COAEverything You Need to Know About Salesforce LMA & COA
Everything You Need to Know About Salesforce LMA & COA
 
Streamline Page Layouts with Dynamic Forms
Streamline Page Layouts with Dynamic FormsStreamline Page Layouts with Dynamic Forms
Streamline Page Layouts with Dynamic Forms
 
Getting to Yes: How to build executive alignment to win big on the AppExchange
Getting to Yes: How to build executive alignment to win big on the AppExchangeGetting to Yes: How to build executive alignment to win big on the AppExchange
Getting to Yes: How to build executive alignment to win big on the AppExchange
 
Ready, Set, Deploy: How Place Technology Streamlined Deployment on the AppExc...
Ready, Set, Deploy: How Place Technology Streamlined Deployment on the AppExc...Ready, Set, Deploy: How Place Technology Streamlined Deployment on the AppExc...
Ready, Set, Deploy: How Place Technology Streamlined Deployment on the AppExc...
 
How FinancialForce Leverages Labs to Accelerate Innovation
How FinancialForce Leverages Labs to Accelerate InnovationHow FinancialForce Leverages Labs to Accelerate Innovation
How FinancialForce Leverages Labs to Accelerate Innovation
 
Acting Like a Top 25 Salesforce ISV: How Appinium Applies Buyer's and Seller'...
Acting Like a Top 25 Salesforce ISV: How Appinium Applies Buyer's and Seller'...Acting Like a Top 25 Salesforce ISV: How Appinium Applies Buyer's and Seller'...
Acting Like a Top 25 Salesforce ISV: How Appinium Applies Buyer's and Seller'...
 
Acting Like a Top 25 Salesforce ISV: Designing the Seller's Journey for the ...
Acting Like a Top 25 Salesforce ISV:  Designing the Seller's Journey for the ...Acting Like a Top 25 Salesforce ISV:  Designing the Seller's Journey for the ...
Acting Like a Top 25 Salesforce ISV: Designing the Seller's Journey for the ...
 
[Tech Webinar] Second Generation Packaging for ISVs
[Tech Webinar] Second Generation Packaging for ISVs[Tech Webinar] Second Generation Packaging for ISVs
[Tech Webinar] Second Generation Packaging for ISVs
 
Webinar: Acting Like a Top 25 Salesforce ISV - Designing Trial Experiences th...
Webinar: Acting Like a Top 25 Salesforce ISV - Designing Trial Experiences th...Webinar: Acting Like a Top 25 Salesforce ISV - Designing Trial Experiences th...
Webinar: Acting Like a Top 25 Salesforce ISV - Designing Trial Experiences th...
 
Webinar: Leveraging Context & Dynamics with Lightning Web Component Configura...
Webinar: Leveraging Context & Dynamics with Lightning Web Component Configura...Webinar: Leveraging Context & Dynamics with Lightning Web Component Configura...
Webinar: Leveraging Context & Dynamics with Lightning Web Component Configura...
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Último (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 

ISV Error Handling With Spring '21 Update

  • 1.
  • 2. ● Who is CodeScience? ● Introduction ● Error handling in ISV Applications ● New In Spring ‘21 ● Using these events in packages ● Demo ● Recap Agenda
  • 3. This is an image placeholder for an image. Please size accordingly. ● Founding partner of the Salesforce Product Development Organization (PDO) Program since 2008 - named Master PDO in 2017 ● PDO Program provides app development services to ISVs for the Salesforce AppExchange ● Partner with clients in various industries to assist in building over 300 apps on the AppExchange ● From design to build to implementation, we support through the full lifecycle Who is CodeScience
  • 4. Client success: 10% of the AppExchange
  • 7. Error Handling In ISV Applications
  • 8. Why do errors occur? ● We aren’t perfect, sometimes there are coding mistakes ● Subscribers often misconfigure applications. Missing permissions, credentials, etc. ● Subscribers may build logic, automation, validations, etc that interfere with the normal function of applications ● Subscriber environments may present unanticipated challenges, such as 50M+ accounts, hundreds of Process Builders, inefficient custom code, elaborate sharing models ● Sometimes, errors just happen
  • 9. Reactive Error Handling ● A subscriber notices some functionality is not working, such as “An Unexpected Error Has Occurred”, Apex jobs are in error state, data is not correct, etc. ● They reach out to your customer support with this information, and you have to help diagnose and fix the issue ● This is time-consuming, costly, and can lead to a loss of trust if it happens often
  • 10. Proactive Error Handling ● You attempt to catch errors that you anticipate, and handle them appropriately ● You attempt to catch anything unexpected, with a few options: ○ Store in a “Log” object with visibility to subscriber, and possible trigger logic ○ Emit an event that can be subscribed to ○ “Phone home” with the information (with explicit subscriber consent) ○ Use FMA FeatureParameterInteger to log error counts ○ Flag “problem” records to exclude from processing ○ Implement a retry mechanism
  • 11. New in Spring ‘21
  • 12. New in Spring ‘21 Use BatchApexErrorEvent Triggers to Monitor ISV Applications ● Include BatchApexErrorEvent triggers in your managed package to monitor the health of batch jobs and take necessary corrective action without any post-installation steps ● This change applies to Lightning Experience and Salesforce Classic ● The BatchApexErrorEvent object represents a platform event associated with a failing batch Apex execution
  • 13. BatchApexErrorEvent ● This is a standard Salesforce event, which can be emitted from Batch Apex Classes that encounter errors ● This event can be subscribed to just like normal Platform Events, as well as being able to handle the events with triggers ● It was released in Winter ‘19, but a trigger handler could not be packaged until Spring ‘21 ● It includes information such as job id, error type, record ids being processed, etc. ● It is triggered on any batch error, including “uncatchable” errors, such as limit exceptions
  • 14. Using These Events In Packages
  • 16. What Information do you get? ● What job id was running, from which you can get Apex class & namespace ● The type of exception ● What IDs of the records that were being processed ● The exception message ● The Phase ● The stack trace*** (caveat on next slide)
  • 17. What are the limitations/concerns? ● No stack trace is available when running from a managed package ● This is a standard event, so you get all subscriber and other package events as well ● You should limit your error processing to just Apex classes in your namespace for both data quality & security reasons ● You still don’t get direct access to the error information, and need consent from your customers to send it to you. ● The JobScope (record ids) is limited to 40k characters (~2100 record ids and commas), after which point it will be truncated and DoesExceedJobScopeMaxLength set to true
  • 18. Demo
  • 19. In Summary... ● This new Spring ‘21 feature fills in a gap of batch error handling ● This should be used in conjunction with other available error-handling, such as catching DML errors in the batch and flagging problem records for follow-up ● You could log this information, subscribe to it, phone home, retry the batch, flag problematic records, increase error counts in FMA… ● All of these options should increase the resiliency of your solution, and make debugging issues easier
  • 21. References ● Salesforce Blog Post - https://developer.salesforce.com/blogs/2019/01/building-a-batch-retry -framework-with-batchapexerrorevent.html ● Developer documentation - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/ape xcode/apex_batch_platformevents.htm ● Technical Documentation - https://developer.salesforce.com/docs/atlas.en-us.platform_events.me ta/platform_events/sforce_api_objects_batchapexerrorevent.htm