SlideShare uma empresa Scribd logo
1 de 19
Partition Your Trigger Logic Using
Metadata
Mitch Spano
Application Engineer - Google
@mitchspano
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the
assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we
make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber
growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new
products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in
our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the
immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new
releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise
customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the
most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures
are available on the SEC Filings section of the Investor Information section of our Website.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be
delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Statement under the Private Securities Litigation Reform Act of
1995
Forward-Looking Statement
Speakers
Mitch Spano
Application Engineer - Google
@mitchspano
If you are an Architect...
• Consider how this framework
can enable your organization
to grow and scale
• Listen for strategies to better
partition your application
If you are a Developer...
• Learn how a metadata driven
trigger framework can allow
you to deliver higher quality
Apex code
• Observe the techniques used
to test Apex used in this
project
If you are a Manager...
• Gain an understanding of the
complexities of working in an
Apex trigger
• Imagine ways this could be
used in a multiple team
environment
Intended Audience
What should you take from this discussion?
Apex Triggers
Background and History
Many Automation Tools
Relative Risk and Power
Flow
Process Builder
Workflow
No Automation
Triggers
Less
Risk/Power
More
Risk/Power
Trigger Logic
Things can get messy
public class OpportunityTriggerHandler extends TriggerHandler {
public override void beforeUpdate() {
for(Opportunity o : (List<Opportunity>) Trigger.new) {
// do something
}
}
// override additional contexts as necessary
}
Existing Frameworks
Separate Trigger from Logic
public class OpportunityTriggerHandler extends TriggerHandler {
public override void afterInsert() {
this.handleWholesaleInsert((List<Opportunity>) Trigger.new);
this.handleRetailInsert((List<Opportunity>) Trigger.new);
}
private void handleWholesaleInsert(List<Opportunity> newList) {
for(Opportunity o : newList) {
// do something
}
}
private void handleRetailInsert(List<Opportunity> newList) {
for(Opportunity o : newList) {
// do something
}
}
}
Existing Frameworks
Handlers Require Modification
public class OpportunityTriggerHandler extends TriggerHandler {
public override void afterInsert() {
this.handleWholesaleInsert((List<Opportunity>) Trigger.new);
this.handleRetailInsert((List<Opportunity>) Trigger.new);
this.recalculateAccountValues((List<Opportunity>) Trigger.new);
this.notifyAMEASales((List<Opportunity>) Trigger.new);
this.setDefaultAccountType((List<Opportunity>) Trigger.new);
this.defineOpportunityContactRoles((List<Opportunity>) Trigger.new);
}
private void handleWholesaleInsert(List<Opportunity> newList) {
for(Opportunity o : newList) {
// do something
}
}
// More methods are implemented and called for every action :(
}
Existing Frameworks
Becomes Unmaintainable
Trigger Actions Framework
A Metadata Driven Approach
Trigger Framework
GitHub Information
https://github.com/mitchspano/apex-trigger-actions-framework
Trigger Framework
Classes and Metadata Types
Trigger Framework
Classes and Metadata Types
Work Together in Teams
Strategies for Working in a Multiple-Team Environment
Working in Multiple Teams
New Package Directories
{
"packageDirectories": [
{
"path": "application/base"
},
{
"path": "application/opportunity-automation"
},
{
"path": "application/retail"
},
{
"path": "application/wholesale",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "50.0"
}
Working in Multiple Teams
Use the Order
Order__c: 2.071
Team Prefix Order
Working in Multiple Teams
Use the Order
Partition Your  (Apex) Trigger Logic Using Metadata

Mais conteúdo relacionado

Mais procurados

How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...
How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...
How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...Salesforce Admins
 
アプリを作った後の運用は万全? Heroku リリース & 運用セミナー
アプリを作った後の運用は万全? Heroku リリース & 運用セミナーアプリを作った後の運用は万全? Heroku リリース & 運用セミナー
アプリを作った後の運用は万全? Heroku リリース & 運用セミナーSalesforce Developers Japan
 
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTipsアドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTipsSalesforce Developers Japan
 
Review, Test and Go! - Deborah Paterick, Helen Lueck, Frank Montoya
Review, Test and Go! - Deborah Paterick, Helen Lueck, Frank MontoyaReview, Test and Go! - Deborah Paterick, Helen Lueck, Frank Montoya
Review, Test and Go! - Deborah Paterick, Helen Lueck, Frank MontoyaSalesforce Admins
 
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon BarlowRollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon BarlowSalesforce Admins
 
Sandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam BarnetSandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam BarnetSalesforce Admins
 
Wave : Analytics Cloudとは
Wave : Analytics CloudとはWave : Analytics Cloudとは
Wave : Analytics CloudとはMitch Okamoto
 
Summer '17 リリース開発者向け新機能Webinar
Summer '17 リリース開発者向け新機能WebinarSummer '17 リリース開発者向け新機能Webinar
Summer '17 リリース開発者向け新機能WebinarSalesforce Developers Japan
 
Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)
Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)
Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)Kevin Richardson
 
アプリケーション開発をモダンに変える Salesforce DX
アプリケーション開発をモダンに変える Salesforce DXアプリケーション開発をモダンに変える Salesforce DX
アプリケーション開発をモダンに変える Salesforce DXSalesforce Developers Japan
 
I Built in Lightning and I Liked It
I Built in Lightning and I Liked ItI Built in Lightning and I Liked It
I Built in Lightning and I Liked ItSalesforce Admins
 
April 9 process capability analysis using confidence reliability calculations
April 9 process capability analysis using confidence reliability calculationsApril 9 process capability analysis using confidence reliability calculations
April 9 process capability analysis using confidence reliability calculationsCompliance Trainings
 
Using the D3 JavaScript Library to Create Modular Visualizations
Using the D3 JavaScript Library to Create Modular VisualizationsUsing the D3 JavaScript Library to Create Modular Visualizations
Using the D3 JavaScript Library to Create Modular VisualizationsSalesforce Developers
 
CCT London 2013 Theatre Intro to Apex
CCT London 2013 Theatre Intro to ApexCCT London 2013 Theatre Intro to Apex
CCT London 2013 Theatre Intro to ApexPeter Chittum
 

Mais procurados (20)

はじめようLightning Component開発
はじめようLightning Component開発はじめようLightning Component開発
はじめようLightning Component開発
 
How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...
How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...
How to Weave Diversity and Inclusion into Your Company's DNA by Brad Schneide...
 
Spring '17開発者向け新機能
Spring '17開発者向け新機能Spring '17開発者向け新機能
Spring '17開発者向け新機能
 
アプリを作った後の運用は万全? Heroku リリース & 運用セミナー
アプリを作った後の運用は万全? Heroku リリース & 運用セミナーアプリを作った後の運用は万全? Heroku リリース & 運用セミナー
アプリを作った後の運用は万全? Heroku リリース & 運用セミナー
 
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTipsアドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
アドバンスドLightningコンポーネント:品質の高いコンポーネント開発のためのTips
 
Review, Test and Go! - Deborah Paterick, Helen Lueck, Frank Montoya
Review, Test and Go! - Deborah Paterick, Helen Lueck, Frank MontoyaReview, Test and Go! - Deborah Paterick, Helen Lueck, Frank Montoya
Review, Test and Go! - Deborah Paterick, Helen Lueck, Frank Montoya
 
DF15_ReviewTestGo
DF15_ReviewTestGoDF15_ReviewTestGo
DF15_ReviewTestGo
 
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon BarlowRollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
Rollin' Out Lightnin' Ain't All That Frightenin' by Jon Barlow
 
Winter '19 開発者向け新機能
Winter '19 開発者向け新機能Winter '19 開発者向け新機能
Winter '19 開発者向け新機能
 
Winter '18 開発者向け新機能
Winter '18 開発者向け新機能Winter '18 開発者向け新機能
Winter '18 開発者向け新機能
 
Sandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam BarnetSandboxes: The Future of App Development by Evan Barnet & Pam Barnet
Sandboxes: The Future of App Development by Evan Barnet & Pam Barnet
 
Wave : Analytics Cloudとは
Wave : Analytics CloudとはWave : Analytics Cloudとは
Wave : Analytics Cloudとは
 
Summer '17 リリース開発者向け新機能Webinar
Summer '17 リリース開発者向け新機能WebinarSummer '17 リリース開発者向け新機能Webinar
Summer '17 リリース開発者向け新機能Webinar
 
Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)
Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)
Dallas Salesforce User Group Meeting - March 2011 (Sponsored by Statera)
 
アプリケーション開発をモダンに変える Salesforce DX
アプリケーション開発をモダンに変える Salesforce DXアプリケーション開発をモダンに変える Salesforce DX
アプリケーション開発をモダンに変える Salesforce DX
 
I Built in Lightning and I Liked It
I Built in Lightning and I Liked ItI Built in Lightning and I Liked It
I Built in Lightning and I Liked It
 
April 9 process capability analysis using confidence reliability calculations
April 9 process capability analysis using confidence reliability calculationsApril 9 process capability analysis using confidence reliability calculations
April 9 process capability analysis using confidence reliability calculations
 
Using the D3 JavaScript Library to Create Modular Visualizations
Using the D3 JavaScript Library to Create Modular VisualizationsUsing the D3 JavaScript Library to Create Modular Visualizations
Using the D3 JavaScript Library to Create Modular Visualizations
 
Batch Jobs: Beyond the Basics
Batch Jobs: Beyond the BasicsBatch Jobs: Beyond the Basics
Batch Jobs: Beyond the Basics
 
CCT London 2013 Theatre Intro to Apex
CCT London 2013 Theatre Intro to ApexCCT London 2013 Theatre Intro to Apex
CCT London 2013 Theatre Intro to Apex
 

Semelhante a Partition Your (Apex) Trigger Logic Using Metadata

Orchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkOrchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkSudipta Deb ☁
 
Bootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDX
Bootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDXBootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDX
Bootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDXAutoRABIT
 
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIsDreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIsHormoz Tarevern
 
TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018Keir Bowden
 
Developing Interactive Tables and Charts in Visualforce
Developing Interactive Tables and Charts in VisualforceDeveloping Interactive Tables and Charts in Visualforce
Developing Interactive Tables and Charts in VisualforceSalesforce Developers
 
Build Together And Deliver Continuously With Salesforce DX
Build Together And Deliver Continuously With Salesforce DXBuild Together And Deliver Continuously With Salesforce DX
Build Together And Deliver Continuously With Salesforce DXLynette Lim
 
Build System Performance Data Analytics Using Wave
Build System Performance Data Analytics Using WaveBuild System Performance Data Analytics Using Wave
Build System Performance Data Analytics Using WaveSalesforce Developers
 
A Beginner's Guide to Lightning Components by Niels Bryna-Low
A Beginner's Guide to Lightning Components by Niels Bryna-LowA Beginner's Guide to Lightning Components by Niels Bryna-Low
A Beginner's Guide to Lightning Components by Niels Bryna-LowSalesforce Admins
 
The Power of One by Steve Molis
The Power of One by Steve MolisThe Power of One by Steve Molis
The Power of One by Steve MolisSalesforce Admins
 
The Power of One by Steve Molis
The Power of One by Steve MolisThe Power of One by Steve Molis
The Power of One by Steve MolisSalesforce Admins
 
Enterprise Analytics - Salesforce.com Toronto User Group Presentation
Enterprise Analytics - Salesforce.com Toronto User Group PresentationEnterprise Analytics - Salesforce.com Toronto User Group Presentation
Enterprise Analytics - Salesforce.com Toronto User Group PresentationTorontoSFDC
 
Planning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperiencePlanning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperienceShell Black
 
Data import options- Salesforce Dreamforce presentation
Data import options- Salesforce Dreamforce presentationData import options- Salesforce Dreamforce presentation
Data import options- Salesforce Dreamforce presentationRich Spitz
 
Release Management: Managing Your Internal Releases
Release Management: Managing Your Internal ReleasesRelease Management: Managing Your Internal Releases
Release Management: Managing Your Internal ReleasesJoshua Hoskins
 
Gesture Controlled Interactions with Platform Events and IoT Explorer
Gesture Controlled Interactions with Platform Events and IoT ExplorerGesture Controlled Interactions with Platform Events and IoT Explorer
Gesture Controlled Interactions with Platform Events and IoT ExplorerSalesforce Developers
 

Semelhante a Partition Your (Apex) Trigger Logic Using Metadata (20)

Orchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions frameworkOrchestrate all of your salesforce automation with the trigger actions framework
Orchestrate all of your salesforce automation with the trigger actions framework
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Bootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDX
Bootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDXBootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDX
Bootstrapping DX in Your Enterprise - AutoRABIT at TrailheaDX
 
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIsDreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
Dreamforce 2014 - Salesforce Python SDK for REST/SOAP APIs
 
TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018TrailheaDX Global Gathering London 2018
TrailheaDX Global Gathering London 2018
 
Developing Interactive Tables and Charts in Visualforce
Developing Interactive Tables and Charts in VisualforceDeveloping Interactive Tables and Charts in Visualforce
Developing Interactive Tables and Charts in Visualforce
 
Introduction to Force.com
Introduction to Force.comIntroduction to Force.com
Introduction to Force.com
 
Einstein Analytics for Developers
Einstein Analytics for DevelopersEinstein Analytics for Developers
Einstein Analytics for Developers
 
Build Together And Deliver Continuously With Salesforce DX
Build Together And Deliver Continuously With Salesforce DXBuild Together And Deliver Continuously With Salesforce DX
Build Together And Deliver Continuously With Salesforce DX
 
Build System Performance Data Analytics Using Wave
Build System Performance Data Analytics Using WaveBuild System Performance Data Analytics Using Wave
Build System Performance Data Analytics Using Wave
 
A Beginner's Guide to Lightning Components by Niels Bryna-Low
A Beginner's Guide to Lightning Components by Niels Bryna-LowA Beginner's Guide to Lightning Components by Niels Bryna-Low
A Beginner's Guide to Lightning Components by Niels Bryna-Low
 
Org Merge Best Practices
Org Merge Best PracticesOrg Merge Best Practices
Org Merge Best Practices
 
The Power of One by Steve Molis
The Power of One by Steve MolisThe Power of One by Steve Molis
The Power of One by Steve Molis
 
The Power of One by Steve Molis
The Power of One by Steve MolisThe Power of One by Steve Molis
The Power of One by Steve Molis
 
Enterprise Analytics - Salesforce.com Toronto User Group Presentation
Enterprise Analytics - Salesforce.com Toronto User Group PresentationEnterprise Analytics - Salesforce.com Toronto User Group Presentation
Enterprise Analytics - Salesforce.com Toronto User Group Presentation
 
Bulkify Your Org
Bulkify Your OrgBulkify Your Org
Bulkify Your Org
 
Planning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning ExperiencePlanning Your Migration to the Lightning Experience
Planning Your Migration to the Lightning Experience
 
Data import options- Salesforce Dreamforce presentation
Data import options- Salesforce Dreamforce presentationData import options- Salesforce Dreamforce presentation
Data import options- Salesforce Dreamforce presentation
 
Release Management: Managing Your Internal Releases
Release Management: Managing Your Internal ReleasesRelease Management: Managing Your Internal Releases
Release Management: Managing Your Internal Releases
 
Gesture Controlled Interactions with Platform Events and IoT Explorer
Gesture Controlled Interactions with Platform Events and IoT ExplorerGesture Controlled Interactions with Platform Events and IoT Explorer
Gesture Controlled Interactions with Platform Events and IoT Explorer
 

Último

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
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 🔝✔️✔️Delhi Call girls
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
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 ...harshavardhanraghave
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
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 Modelsaagamshah0812
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 

Último (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
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 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
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 ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
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
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 

Partition Your (Apex) Trigger Logic Using Metadata

  • 1. Partition Your Trigger Logic Using Metadata Mitch Spano Application Engineer - Google @mitchspano
  • 2. This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Website. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements. Statement under the Private Securities Litigation Reform Act of 1995 Forward-Looking Statement
  • 4. If you are an Architect... • Consider how this framework can enable your organization to grow and scale • Listen for strategies to better partition your application If you are a Developer... • Learn how a metadata driven trigger framework can allow you to deliver higher quality Apex code • Observe the techniques used to test Apex used in this project If you are a Manager... • Gain an understanding of the complexities of working in an Apex trigger • Imagine ways this could be used in a multiple team environment Intended Audience What should you take from this discussion?
  • 6. Many Automation Tools Relative Risk and Power Flow Process Builder Workflow No Automation Triggers Less Risk/Power More Risk/Power
  • 8. public class OpportunityTriggerHandler extends TriggerHandler { public override void beforeUpdate() { for(Opportunity o : (List<Opportunity>) Trigger.new) { // do something } } // override additional contexts as necessary } Existing Frameworks Separate Trigger from Logic
  • 9. public class OpportunityTriggerHandler extends TriggerHandler { public override void afterInsert() { this.handleWholesaleInsert((List<Opportunity>) Trigger.new); this.handleRetailInsert((List<Opportunity>) Trigger.new); } private void handleWholesaleInsert(List<Opportunity> newList) { for(Opportunity o : newList) { // do something } } private void handleRetailInsert(List<Opportunity> newList) { for(Opportunity o : newList) { // do something } } } Existing Frameworks Handlers Require Modification
  • 10. public class OpportunityTriggerHandler extends TriggerHandler { public override void afterInsert() { this.handleWholesaleInsert((List<Opportunity>) Trigger.new); this.handleRetailInsert((List<Opportunity>) Trigger.new); this.recalculateAccountValues((List<Opportunity>) Trigger.new); this.notifyAMEASales((List<Opportunity>) Trigger.new); this.setDefaultAccountType((List<Opportunity>) Trigger.new); this.defineOpportunityContactRoles((List<Opportunity>) Trigger.new); } private void handleWholesaleInsert(List<Opportunity> newList) { for(Opportunity o : newList) { // do something } } // More methods are implemented and called for every action :( } Existing Frameworks Becomes Unmaintainable
  • 11. Trigger Actions Framework A Metadata Driven Approach
  • 15. Work Together in Teams Strategies for Working in a Multiple-Team Environment
  • 16. Working in Multiple Teams New Package Directories { "packageDirectories": [ { "path": "application/base" }, { "path": "application/opportunity-automation" }, { "path": "application/retail" }, { "path": "application/wholesale", "default": true } ], "namespace": "", "sfdcLoginUrl": "https://login.salesforce.com", "sourceApiVersion": "50.0" }
  • 17. Working in Multiple Teams Use the Order Order__c: 2.071 Team Prefix Order
  • 18. Working in Multiple Teams Use the Order