SlideShare a Scribd company logo
1 of 62
#tahoedreamin18
It simply works... until
it breaks
#tahoedreamin18
Daniel Stange
Technical Architect
die.interaktiven | Salesforce User
Groups
Found Salesforce boring in the dark ages -
Changed my mind.
Frankfurt, Germany User Group Lead
You can find me at @stangomat
Meighan Brodkey
Technical Architect
SR Consulting | Salesforce User
Groups
10 years in the ecosystem, from admin to
architect. Love the platform and giving back to the
the Ohana.
Seattle WIT User Group Leader.
You can find me at @MeighanSF
#tahoedreamin18
To build awesome and robust point & click
solutions, you need to think and work in
patterns Salesforce developers should know
by heart.
#tahoedreamin18
And we don‘t mean common Salesforce
developer patterns...
#tahoedreamin18
Reminder: SOME
Salesforce devs...
Do documentation
/*
* 2012 by Daniel
* TODO: docs
*/
Build for scale
for (Account a : accs)
{
update a;
}
Build unit tests
@isTest
...
i++;
i++;
Use inline comments
//doing some magic here
#tahoedreamin18
Every developer can do better...
Including you, no-code jedi!
#tahoedreamin18
Agenda
You can be a better developer without having to be a developer at all:
◇ Think and work in enterprise development patterns (...just without the code)
◇ Design
◇ Build
◇ Test
◇ Deploy
#tahoedreamin18
Great Patterns
◇ Change Management
◇ Documentation
◇ Consistency
◇ Simplicity
◇ Scalability
◇ Test-Driven
#tahoedreamin18
Change Management
◇ Restrict changes in productive org to Reports, Dashboard and List views
◇ Establish one user who authorizes the migration of any change to production
◇ Establish a consistent workflow to migrate your metadata
◇ Establish a consistent way to model data for your project
#tahoedreamin18
Documentation
◇ Knowledge about your org and changes has to be stored where it is accessible
◇ Index of objects and logic should be the minimum
◇ Aim big: Create full business process and implementation logic for new stuff and
add old stuff whenever you touch it
Little Helpers
◇ Elements Cloud (freemium)
◇ Config Workbook (app exchange)
◇ Wiki & Issue Trackers (e.g. Jira/Confluence)
#tahoedreamin18
Consistency
◇ Naming Conventions
◇ Data Modeling
◇ Layouts
◇ Establish Paradigms that your users can learn and recognize
#tahoedreamin18
Simplicity
◇ Choose simple and performant solutions
◇ Prefer accessible solutions
◇ Avoid monoliths - break down complex logic
#tahoedreamin18
Scalability
◇ Any logic has to work if you change one record, but also for millions of records
or thousands of users at the same time
#tahoedreamin18
Test-Driven
◇ Model your solutions to solve test cases
◇ Model your testing to stress every aspect of your solution
◇ Try to break your solution to smaller, testable parts and keep notes on how to
test them, incl. expected outcomes
Little Helpers:
◇ Metadata tools like Copado or Gearset offer test execution schedules and
change monitoring (partly even in free plans)
#tahoedreamin18
Design
#tahoedreamin18
Start with documentation
◇ User Story Pattern: “As <Person> I need <Functionality> to
<Problem to be solved>”
◇ Acceptance Criteria
◇ Add a solution design and/or flow chart, entity-relationship
diagrams etc.
Little Helpers:
Agile Accelerator (AppExchange)
Issue Trackers (e.g. Jira)
Copado Change Management (AppExchange)
elements.cloud / gliffy / LucidCharts
#tahoedreamin18
Inspect existing logic
◇ Make sure you understand any logic that already exists for
the relevant objects
◇ Document your findings, if no docs are available yet
◇ Consider modularizing and/or extending existing logic
#tahoedreamin18
Choose your toolset
◇ If possible, stick to one automation tool per object
◇ If possible, use one master process per object and “handlers”
to extend the master process
◇ Don’t be afraid of Flows
◇ … but try to use the most simple tool to solve a problem
Visit David Liu‘s session today:
Clicks vs Code – which one should you choose?
5:10 pm, Sand Harbor II
#tahoedreamin18
Caution
when mixing automation tools.
(Apex often adds an explosive
component)
Hidden gem:
Perspectives in the Developer Console allow you to
inspect the execution of your logic.
#tahoedreamin18
Plan for Scale
Make sure everything can handle
at least 200 records at a time.
#tahoedreamin18
Be specific
Use specific Entry Conditions
for Automations to reduce
workload and “false positives”
#tahoedreamin18
No Apex,
No Limits?
Declarative tools consume
governor limits and are subject to
platform restrictions
#tahoedreamin18
Shared ressources
Whenever one or more records are created, updated, deleted, undeleted
◇ all logic shares limits in a single context
(except managed packages)
◇ 50,000 records can be loaded in 100 operations
◇ 10,000 records can be changed in the database in 150 operation
◇ if more than one record is sent to the database, up to 200 records are
handled at the same time
◇ you cannot edit System data (e.g. Users) and regular data (e.g.
Opportunities) in the same context (“mixed DML”)
#tahoedreamin18
Build
#tahoedreamin18
You need a
sandbox
NO EXCUSES
#tahoedreamin18
#tahoedreamin18
Development
Lifecycle
◇ Create development environments.
◇ Develop using Salesforce Web and local tools.
◇ Create testing environments, including UAT and integration.
◇ Migrate changes from development environment to integration environment.
◇ Test.
◇ Migrate changes from integration environment to UAT environment.
◇ Perform user-acceptance tests.
◇ Migrate changes from UAT environment to staging environment.
◇ Replicate production changes in staging environment.
◇ Schedule the release.
#tahoedreamin18
Before you start
◇ Run all local unit tests to verify that your development
environment is clean.
In case of failures:
◇ Take notes of what failed and why
◇ Address the resolution of all failing tests with the client /
developers / your team
#tahoedreamin18
Execution Order
◇ Triggers run before almost all declarative tools
◇ Workflows fire triggers once again (and just once)
◇ Processes and flows run almost at the end of the operation (but
can and will fire triggers, again
◇ Emails sending happens after finally committing the record to the
database
◇ Time based logic will re-evaluated at the time of execution
#tahoedreamin18
Using entry criteria
Entry criteria
◇ should filter and reduce so that logic is only executed for relevant record
◇ validate all required data
Some friends to remember
◇ ISCHANGED(), PRIORVALUE() functions
◇ “changed to subsequently meet criteria” setting for workflow rules
◇ recursive execution option for process builder
#tahoedreamin18
Using null checks
◇ absolutely required if you are using data from related records
◇ always check use ISBLANK() or ISNULL() before your access a related record)
and to avoid unintended copying of blank values
#tahoedreamin18
Opportunity
Using related
records
Account
SOQL Query
Opportunity
Line Items
SOQL Query
DML
#tahoedreamin18
Using related records
◇ Pulling in data from relating records in process builder consumes 1 SOQL query
and SOQL rows
◇ Updating related records consumes 1 DML statement and DML rows
◇ Updating related records fires triggers and declarative logic on the related object
- the context is getting bigger
◇ Flow and process builder are “bulkified by design”, but you have to help
#tahoedreamin18
Using no-code futures
A “future” call is simple way to tell code: Do that later outside of my current context.
◇ own resources & limit
◇ but no context of the current operation (e.g. PRIORVALUE() / Trigger.old)
If you invoke a process or flow from process builder, that essential works like a future
call (just without code)
#tahoedreamin18
The record couldn‘t be saved because
it failed to trigger a flow.
A flow trigger failed to execute
the flow with version ID
301b0000000g2s6.
When it breaks...
#tahoedreamin18
An error occurred at element
myRule_4_A2 (FlowRecordUpdate).
Too many SOQL queries: 101
#tahoedreamin18
When it breaks...
◇ Browser extensions like Salesforce Inspector help you find the flow by Id
◇ Developer Console “Analysis Perspective” helps you inspect the logic and
shows limit consumption
#tahoedreamin18
Debugging for No-Coders
◇ Read all messages carefully to identify IDs, component names
and possible error reasons.
◇ Use chatter, email, or platform events to publish steps into groups
/ emails / channels, or to the record’s feed
◇ Use the fault handler in Flow
#tahoedreamin18
It works!
Let‘s deploy
#tahoedreamin18
No
Well...
#tahoedreamin18
There‘s stuff to do
◇ Documentation.
It‘s part of building. Seriously.
◇ Test it
And by testing, we mean testing. Thorough testing.
◇ Review it
In pairs or teams. You can‘t review your own work. Seriously
(again)
◇ Deploy now you can, young padawan.
#tahoedreamin18
Documentation
◇ Overall rationale of the development
◇ Flow charts / Description of the logic
◇ Components
Did you think of
◇ Deployment Steps
◇ Consistently name all components
◇ Consistently fill description fields
◇ Add meaningful help texts
#tahoedreamin18
Test
#tahoedreamin18
Manual Testing
Run tests
Apex Unit Tests
Bulk Test
#tahoedreamin18
Manual Testing
◇ Does the logic work as described?
◇ Are all acceptance criteria satisfied?
◇ Does the logic affect you when you’re doing unrelated things?
◇ Can you create conditions that cause your logic to break?
◇ Test bad data, missing data, entry criteria too (negative testing
patterns)
#tahoedreamin18
Apex Unit Test
◇ Run all local unit tests to verify that all tests still complete
◇ Did you break something
#tahoedreamin18
Bulk Testing
◇ Keep (or create) CSV files for meaningful bulk tests
◇ Test all database operations (insert, update, delete, undelete)
◇ Verify results vs. your expectations
◇ Check logs for errors
#tahoedreamin18
User Acceptance Tests
◇ Let key users test drive your development
◇ Ask them do routine work
◇ Ask them to solve the problem they were thinking of when giving
their “user stories”
#tahoedreamin18
Deploy
#tahoedreamin18
Towards
Deployment
◇ Make and communicate a release plan
◇ Train your users
◇ Prepare your deployment (Documentation & Bundle)
◇ Backup Data
◇ Create a fresh Sandbox as a Metadata Backup
◇ Dry run (if needed)
#tahoedreamin18
Release Planning
◇ Use off-peak hours and days
◇ Communication is key
◇ No surprises
◇ Allow people
◇ No pre-weekend, pre-holidays, last-hour-of-the-day exercises
#tahoedreamin18
Training
◇ Realistic scenarios that users can relate to - in a sandbox
◇ Consider pre-built datasets and ETL or using DX to create
environments
◇ Again: Documentation and Communication is key
◇ Chatter group & Files / Libraries for end user documentation and
training (recorded sessions, manuals, cheat sheets etc.)
#tahoedreamin18
Deployment
Documentation
◇ Step-Number and/or Order of Steps
◇ Manual PRE-deployment tasks
◇ Deployment tasks
◇ Components (Metadata Type, Object, Name/Label, API-Name)
◇ Manual POST-deployment tasks
#tahoedreamin18
Backup
◇ Create a fresh Sandbox off Production as a metadata backup
◇ Use your favorite ETL tool for a data backup
◇ Prepare your deployment bundle in the backup sandbox to
overwrite your changes in case you need to roll back your
changes (“negative changeset strategy”)
#tahoedreamin18
Dry Run
◇ Create a fresh Sandbox off Production as a dummy target
◇ Send your changeset and walk through your deployment
document
#tahoedreamin18
Deploy
◇ There are limits to Metadata types that can be deployed
◇ Changeset deployments through a deployment path are tedious
and prone to errors like missing components etc.
◇ Browser extensions can support the process
◇ Metadata API is the preferable way
◇ Lots of free tools (DX and Ant Tool) and paid ones (Gearset,
AutoRabit, Flosum, Copado)
#tahoedreamin18
Finishing Up
◇ If you had processes and flows in your deployment, make sure
they are activated (these components are deployed in Inactive
state)
◇ If you did activate something - run local Apex tests again (you
won’t see damage earlier…)
#tahoedreamin18
Trailhead
◇ Deployment tools:
https://trailhead.salesforce.com/modules/alm_deployment/units/alm_tools
◇ Efficient Deployments:
https://trailhead.salesforce.com/modules/alm_deployment/units/alm_migrate_testing
◇ Plan Your Deployment:
https://trailhead.salesforce.com/modules/alm_deployment/units/alm_deploy
◇ Application Lifecycle Management Basics:
https://trailhead.salesforce.com/modules/alm_deployment/
units/alm_intro
◇ Learn More About Sandboxes:
https://trailhead.salesforce.com/modules/alm_deployment/units/
alm_sandbox
#tahoedreamin18
Resources
● Process Limits:
https://help.salesforce.com/articleView?id=process_limits.htm&type=5
● Order of Execution: https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm
● Deploying Flows
https://help.salesforce.com/articleView?id=process_changesets_packaging.htm&
type=5
#tahoedreamin18
Thanks!
Q&A - Any questions?
Connect with us:
◇ @meighanSF | meighanrockssf@gmail.com
◇ @stangomat | daniel.stange@die-interaktiven.de
◇ Slides at http://bit.ly/untilitbreaks
#tahoedreamin18
Addendum
● BlueCanvas.io can really do metadata backup. They emailed me on my
remark in the session. Check https://bluecanvas.io/2017/04/18/salesforce-
disaster-recovery.html
● Automated testing: Provar is a full scale solution. Coders should consider
including Nightwatch JS in their build scripts
● If you feel comfortable with the command line, you have to try out the
Salesforce CLI that comes with the Salesforce DX installation
● https://developer.salesforce.com/docs/atlas.en-
us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
#tahoedreamin18
Blogpost to come
● http://blog.danielstange.de/2018/01/20/tahoedreamin18/

More Related Content

Similar to Tahoe Dreamin 2018: It simply works... until it breaks!

Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Daniel Zivkovic
 
7.4 Admin Tools and Best Practices
7.4 Admin Tools and Best Practices7.4 Admin Tools and Best Practices
7.4 Admin Tools and Best PracticesTargetX
 
Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)Doria Hamelryk
 
Make your data fly - Building data platform in AWS
Make your data fly - Building data platform in AWSMake your data fly - Building data platform in AWS
Make your data fly - Building data platform in AWSKimmo Kantojärvi
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...DevSecCon
 
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin TimmermannO365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin TimmermannNCCOMMS
 
Data Engineer's Lunch #60: Series - Developing Enterprise Consciousness
Data Engineer's Lunch #60: Series - Developing Enterprise ConsciousnessData Engineer's Lunch #60: Series - Developing Enterprise Consciousness
Data Engineer's Lunch #60: Series - Developing Enterprise ConsciousnessAnant Corporation
 
Владимир Дубина - Meet Magento Ukraine - Data consistency
Владимир Дубина - Meet Magento Ukraine - Data consistencyВладимир Дубина - Meet Magento Ukraine - Data consistency
Владимир Дубина - Meet Magento Ukraine - Data consistencyAtwix
 
Making your user happy – how to create a perfect profile
Making your user happy – how to create a perfect profileMaking your user happy – how to create a perfect profile
Making your user happy – how to create a perfect profileLetsConnect
 
DITA Open Toolkit Deployment with XMetaL Author Enterprise 6
DITA Open Toolkit Deployment with XMetaL Author Enterprise 6DITA Open Toolkit Deployment with XMetaL Author Enterprise 6
DITA Open Toolkit Deployment with XMetaL Author Enterprise 6XMetaL
 
Agile Change and Release Management at the #1 Online Rental Site in the US
Agile Change and Release Management at the #1 Online Rental Site in the USAgile Change and Release Management at the #1 Online Rental Site in the US
Agile Change and Release Management at the #1 Online Rental Site in the USMatt Stratton
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5SSW
 
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...AOE
 
Write Generic Code with the Tooling API
Write Generic Code with the Tooling APIWrite Generic Code with the Tooling API
Write Generic Code with the Tooling APIAdam Olshansky
 
Dynamics 365 saturday 2018 - data migration story
Dynamics 365 saturday   2018 - data migration storyDynamics 365 saturday   2018 - data migration story
Dynamics 365 saturday 2018 - data migration storyAndre Margono
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesDrew Hansen
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentAbid Malik
 

Similar to Tahoe Dreamin 2018: It simply works... until it breaks! (20)

Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
Canadian Experts Discuss Modern Data Stacks and Cloud Computing for 5 Years o...
 
7.4 Admin Tools and Best Practices
7.4 Admin Tools and Best Practices7.4 Admin Tools and Best Practices
7.4 Admin Tools and Best Practices
 
Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)Découverte d'Einstein Analytics (Tableau CRM)
Découverte d'Einstein Analytics (Tableau CRM)
 
More about PHP
More about PHPMore about PHP
More about PHP
 
Make your data fly - Building data platform in AWS
Make your data fly - Building data platform in AWSMake your data fly - Building data platform in AWS
Make your data fly - Building data platform in AWS
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
 
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin TimmermannO365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
 
Data Engineer's Lunch #60: Series - Developing Enterprise Consciousness
Data Engineer's Lunch #60: Series - Developing Enterprise ConsciousnessData Engineer's Lunch #60: Series - Developing Enterprise Consciousness
Data Engineer's Lunch #60: Series - Developing Enterprise Consciousness
 
Владимир Дубина - Meet Magento Ukraine - Data consistency
Владимир Дубина - Meet Magento Ukraine - Data consistencyВладимир Дубина - Meet Magento Ukraine - Data consistency
Владимир Дубина - Meet Magento Ukraine - Data consistency
 
Making your user happy – how to create a perfect profile
Making your user happy – how to create a perfect profileMaking your user happy – how to create a perfect profile
Making your user happy – how to create a perfect profile
 
Resume_Vellaiyan
Resume_VellaiyanResume_Vellaiyan
Resume_Vellaiyan
 
DITA Open Toolkit Deployment with XMetaL Author Enterprise 6
DITA Open Toolkit Deployment with XMetaL Author Enterprise 6DITA Open Toolkit Deployment with XMetaL Author Enterprise 6
DITA Open Toolkit Deployment with XMetaL Author Enterprise 6
 
Agile Change and Release Management at the #1 Online Rental Site in the US
Agile Change and Release Management at the #1 Online Rental Site in the USAgile Change and Release Management at the #1 Online Rental Site in the US
Agile Change and Release Management at the #1 Online Rental Site in the US
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
 
Write Generic Code with the Tooling API
Write Generic Code with the Tooling APIWrite Generic Code with the Tooling API
Write Generic Code with the Tooling API
 
Dynamics 365 saturday 2018 - data migration story
Dynamics 365 saturday   2018 - data migration storyDynamics 365 saturday   2018 - data migration story
Dynamics 365 saturday 2018 - data migration story
 
Snowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD PipelinesSnowflake Automated Deployments / CI/CD Pipelines
Snowflake Automated Deployments / CI/CD Pipelines
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 

More from Daniel Stange

Force Academy '19: I fell in love with clicks AND code - here's what I learne...
Force Academy '19: I fell in love with clicks AND code - here's what I learne...Force Academy '19: I fell in love with clicks AND code - here's what I learne...
Force Academy '19: I fell in love with clicks AND code - here's what I learne...Daniel Stange
 
YeurDreamin' - Put the Wow! into your Flow with Lightning Experience
YeurDreamin'  - Put the Wow! into your Flow with Lightning ExperienceYeurDreamin'  - Put the Wow! into your Flow with Lightning Experience
YeurDreamin' - Put the Wow! into your Flow with Lightning ExperienceDaniel Stange
 
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsSetting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsDaniel Stange
 
Route your triggers like a pro #DF18
Route your triggers like a pro #DF18Route your triggers like a pro #DF18
Route your triggers like a pro #DF18Daniel Stange
 
Your admin toolbelt is not complete without Salesforce DX
Your admin toolbelt is not complete without Salesforce DXYour admin toolbelt is not complete without Salesforce DX
Your admin toolbelt is not complete without Salesforce DXDaniel Stange
 
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Gear up for Continuous Integration with Salesforce DX, Circle CI and ClaytonGear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Gear up for Continuous Integration with Salesforce DX, Circle CI and ClaytonDaniel Stange
 

More from Daniel Stange (6)

Force Academy '19: I fell in love with clicks AND code - here's what I learne...
Force Academy '19: I fell in love with clicks AND code - here's what I learne...Force Academy '19: I fell in love with clicks AND code - here's what I learne...
Force Academy '19: I fell in love with clicks AND code - here's what I learne...
 
YeurDreamin' - Put the Wow! into your Flow with Lightning Experience
YeurDreamin'  - Put the Wow! into your Flow with Lightning ExperienceYeurDreamin'  - Put the Wow! into your Flow with Lightning Experience
YeurDreamin' - Put the Wow! into your Flow with Lightning Experience
 
Setting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce AppsSetting Up CircleCI Workflows for Your Salesforce Apps
Setting Up CircleCI Workflows for Your Salesforce Apps
 
Route your triggers like a pro #DF18
Route your triggers like a pro #DF18Route your triggers like a pro #DF18
Route your triggers like a pro #DF18
 
Your admin toolbelt is not complete without Salesforce DX
Your admin toolbelt is not complete without Salesforce DXYour admin toolbelt is not complete without Salesforce DX
Your admin toolbelt is not complete without Salesforce DX
 
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Gear up for Continuous Integration with Salesforce DX, Circle CI and ClaytonGear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
Gear up for Continuous Integration with Salesforce DX, Circle CI and Clayton
 

Recently uploaded

GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 

Recently uploaded (20)

GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 

Tahoe Dreamin 2018: It simply works... until it breaks!

  • 2. #tahoedreamin18 Daniel Stange Technical Architect die.interaktiven | Salesforce User Groups Found Salesforce boring in the dark ages - Changed my mind. Frankfurt, Germany User Group Lead You can find me at @stangomat Meighan Brodkey Technical Architect SR Consulting | Salesforce User Groups 10 years in the ecosystem, from admin to architect. Love the platform and giving back to the the Ohana. Seattle WIT User Group Leader. You can find me at @MeighanSF
  • 3. #tahoedreamin18 To build awesome and robust point & click solutions, you need to think and work in patterns Salesforce developers should know by heart.
  • 4. #tahoedreamin18 And we don‘t mean common Salesforce developer patterns...
  • 5. #tahoedreamin18 Reminder: SOME Salesforce devs... Do documentation /* * 2012 by Daniel * TODO: docs */ Build for scale for (Account a : accs) { update a; } Build unit tests @isTest ... i++; i++; Use inline comments //doing some magic here
  • 6. #tahoedreamin18 Every developer can do better... Including you, no-code jedi!
  • 7. #tahoedreamin18 Agenda You can be a better developer without having to be a developer at all: ◇ Think and work in enterprise development patterns (...just without the code) ◇ Design ◇ Build ◇ Test ◇ Deploy
  • 8. #tahoedreamin18 Great Patterns ◇ Change Management ◇ Documentation ◇ Consistency ◇ Simplicity ◇ Scalability ◇ Test-Driven
  • 9. #tahoedreamin18 Change Management ◇ Restrict changes in productive org to Reports, Dashboard and List views ◇ Establish one user who authorizes the migration of any change to production ◇ Establish a consistent workflow to migrate your metadata ◇ Establish a consistent way to model data for your project
  • 10. #tahoedreamin18 Documentation ◇ Knowledge about your org and changes has to be stored where it is accessible ◇ Index of objects and logic should be the minimum ◇ Aim big: Create full business process and implementation logic for new stuff and add old stuff whenever you touch it Little Helpers ◇ Elements Cloud (freemium) ◇ Config Workbook (app exchange) ◇ Wiki & Issue Trackers (e.g. Jira/Confluence)
  • 11. #tahoedreamin18 Consistency ◇ Naming Conventions ◇ Data Modeling ◇ Layouts ◇ Establish Paradigms that your users can learn and recognize
  • 12. #tahoedreamin18 Simplicity ◇ Choose simple and performant solutions ◇ Prefer accessible solutions ◇ Avoid monoliths - break down complex logic
  • 13. #tahoedreamin18 Scalability ◇ Any logic has to work if you change one record, but also for millions of records or thousands of users at the same time
  • 14. #tahoedreamin18 Test-Driven ◇ Model your solutions to solve test cases ◇ Model your testing to stress every aspect of your solution ◇ Try to break your solution to smaller, testable parts and keep notes on how to test them, incl. expected outcomes Little Helpers: ◇ Metadata tools like Copado or Gearset offer test execution schedules and change monitoring (partly even in free plans)
  • 16. #tahoedreamin18 Start with documentation ◇ User Story Pattern: “As <Person> I need <Functionality> to <Problem to be solved>” ◇ Acceptance Criteria ◇ Add a solution design and/or flow chart, entity-relationship diagrams etc. Little Helpers: Agile Accelerator (AppExchange) Issue Trackers (e.g. Jira) Copado Change Management (AppExchange) elements.cloud / gliffy / LucidCharts
  • 17. #tahoedreamin18 Inspect existing logic ◇ Make sure you understand any logic that already exists for the relevant objects ◇ Document your findings, if no docs are available yet ◇ Consider modularizing and/or extending existing logic
  • 18. #tahoedreamin18 Choose your toolset ◇ If possible, stick to one automation tool per object ◇ If possible, use one master process per object and “handlers” to extend the master process ◇ Don’t be afraid of Flows ◇ … but try to use the most simple tool to solve a problem Visit David Liu‘s session today: Clicks vs Code – which one should you choose? 5:10 pm, Sand Harbor II
  • 19. #tahoedreamin18 Caution when mixing automation tools. (Apex often adds an explosive component) Hidden gem: Perspectives in the Developer Console allow you to inspect the execution of your logic.
  • 20. #tahoedreamin18 Plan for Scale Make sure everything can handle at least 200 records at a time.
  • 21. #tahoedreamin18 Be specific Use specific Entry Conditions for Automations to reduce workload and “false positives”
  • 22. #tahoedreamin18 No Apex, No Limits? Declarative tools consume governor limits and are subject to platform restrictions
  • 23. #tahoedreamin18 Shared ressources Whenever one or more records are created, updated, deleted, undeleted ◇ all logic shares limits in a single context (except managed packages) ◇ 50,000 records can be loaded in 100 operations ◇ 10,000 records can be changed in the database in 150 operation ◇ if more than one record is sent to the database, up to 200 records are handled at the same time ◇ you cannot edit System data (e.g. Users) and regular data (e.g. Opportunities) in the same context (“mixed DML”)
  • 27. #tahoedreamin18 Development Lifecycle ◇ Create development environments. ◇ Develop using Salesforce Web and local tools. ◇ Create testing environments, including UAT and integration. ◇ Migrate changes from development environment to integration environment. ◇ Test. ◇ Migrate changes from integration environment to UAT environment. ◇ Perform user-acceptance tests. ◇ Migrate changes from UAT environment to staging environment. ◇ Replicate production changes in staging environment. ◇ Schedule the release.
  • 28. #tahoedreamin18 Before you start ◇ Run all local unit tests to verify that your development environment is clean. In case of failures: ◇ Take notes of what failed and why ◇ Address the resolution of all failing tests with the client / developers / your team
  • 29. #tahoedreamin18 Execution Order ◇ Triggers run before almost all declarative tools ◇ Workflows fire triggers once again (and just once) ◇ Processes and flows run almost at the end of the operation (but can and will fire triggers, again ◇ Emails sending happens after finally committing the record to the database ◇ Time based logic will re-evaluated at the time of execution
  • 30. #tahoedreamin18 Using entry criteria Entry criteria ◇ should filter and reduce so that logic is only executed for relevant record ◇ validate all required data Some friends to remember ◇ ISCHANGED(), PRIORVALUE() functions ◇ “changed to subsequently meet criteria” setting for workflow rules ◇ recursive execution option for process builder
  • 31. #tahoedreamin18 Using null checks ◇ absolutely required if you are using data from related records ◇ always check use ISBLANK() or ISNULL() before your access a related record) and to avoid unintended copying of blank values
  • 33. #tahoedreamin18 Using related records ◇ Pulling in data from relating records in process builder consumes 1 SOQL query and SOQL rows ◇ Updating related records consumes 1 DML statement and DML rows ◇ Updating related records fires triggers and declarative logic on the related object - the context is getting bigger ◇ Flow and process builder are “bulkified by design”, but you have to help
  • 34. #tahoedreamin18 Using no-code futures A “future” call is simple way to tell code: Do that later outside of my current context. ◇ own resources & limit ◇ but no context of the current operation (e.g. PRIORVALUE() / Trigger.old) If you invoke a process or flow from process builder, that essential works like a future call (just without code)
  • 35. #tahoedreamin18 The record couldn‘t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301b0000000g2s6. When it breaks...
  • 36. #tahoedreamin18 An error occurred at element myRule_4_A2 (FlowRecordUpdate). Too many SOQL queries: 101
  • 37. #tahoedreamin18 When it breaks... ◇ Browser extensions like Salesforce Inspector help you find the flow by Id ◇ Developer Console “Analysis Perspective” helps you inspect the logic and shows limit consumption
  • 38. #tahoedreamin18 Debugging for No-Coders ◇ Read all messages carefully to identify IDs, component names and possible error reasons. ◇ Use chatter, email, or platform events to publish steps into groups / emails / channels, or to the record’s feed ◇ Use the fault handler in Flow
  • 41. #tahoedreamin18 There‘s stuff to do ◇ Documentation. It‘s part of building. Seriously. ◇ Test it And by testing, we mean testing. Thorough testing. ◇ Review it In pairs or teams. You can‘t review your own work. Seriously (again) ◇ Deploy now you can, young padawan.
  • 42. #tahoedreamin18 Documentation ◇ Overall rationale of the development ◇ Flow charts / Description of the logic ◇ Components Did you think of ◇ Deployment Steps ◇ Consistently name all components ◇ Consistently fill description fields ◇ Add meaningful help texts
  • 45. #tahoedreamin18 Manual Testing ◇ Does the logic work as described? ◇ Are all acceptance criteria satisfied? ◇ Does the logic affect you when you’re doing unrelated things? ◇ Can you create conditions that cause your logic to break? ◇ Test bad data, missing data, entry criteria too (negative testing patterns)
  • 46. #tahoedreamin18 Apex Unit Test ◇ Run all local unit tests to verify that all tests still complete ◇ Did you break something
  • 47. #tahoedreamin18 Bulk Testing ◇ Keep (or create) CSV files for meaningful bulk tests ◇ Test all database operations (insert, update, delete, undelete) ◇ Verify results vs. your expectations ◇ Check logs for errors
  • 48. #tahoedreamin18 User Acceptance Tests ◇ Let key users test drive your development ◇ Ask them do routine work ◇ Ask them to solve the problem they were thinking of when giving their “user stories”
  • 50. #tahoedreamin18 Towards Deployment ◇ Make and communicate a release plan ◇ Train your users ◇ Prepare your deployment (Documentation & Bundle) ◇ Backup Data ◇ Create a fresh Sandbox as a Metadata Backup ◇ Dry run (if needed)
  • 51. #tahoedreamin18 Release Planning ◇ Use off-peak hours and days ◇ Communication is key ◇ No surprises ◇ Allow people ◇ No pre-weekend, pre-holidays, last-hour-of-the-day exercises
  • 52. #tahoedreamin18 Training ◇ Realistic scenarios that users can relate to - in a sandbox ◇ Consider pre-built datasets and ETL or using DX to create environments ◇ Again: Documentation and Communication is key ◇ Chatter group & Files / Libraries for end user documentation and training (recorded sessions, manuals, cheat sheets etc.)
  • 53. #tahoedreamin18 Deployment Documentation ◇ Step-Number and/or Order of Steps ◇ Manual PRE-deployment tasks ◇ Deployment tasks ◇ Components (Metadata Type, Object, Name/Label, API-Name) ◇ Manual POST-deployment tasks
  • 54. #tahoedreamin18 Backup ◇ Create a fresh Sandbox off Production as a metadata backup ◇ Use your favorite ETL tool for a data backup ◇ Prepare your deployment bundle in the backup sandbox to overwrite your changes in case you need to roll back your changes (“negative changeset strategy”)
  • 55. #tahoedreamin18 Dry Run ◇ Create a fresh Sandbox off Production as a dummy target ◇ Send your changeset and walk through your deployment document
  • 56. #tahoedreamin18 Deploy ◇ There are limits to Metadata types that can be deployed ◇ Changeset deployments through a deployment path are tedious and prone to errors like missing components etc. ◇ Browser extensions can support the process ◇ Metadata API is the preferable way ◇ Lots of free tools (DX and Ant Tool) and paid ones (Gearset, AutoRabit, Flosum, Copado)
  • 57. #tahoedreamin18 Finishing Up ◇ If you had processes and flows in your deployment, make sure they are activated (these components are deployed in Inactive state) ◇ If you did activate something - run local Apex tests again (you won’t see damage earlier…)
  • 58. #tahoedreamin18 Trailhead ◇ Deployment tools: https://trailhead.salesforce.com/modules/alm_deployment/units/alm_tools ◇ Efficient Deployments: https://trailhead.salesforce.com/modules/alm_deployment/units/alm_migrate_testing ◇ Plan Your Deployment: https://trailhead.salesforce.com/modules/alm_deployment/units/alm_deploy ◇ Application Lifecycle Management Basics: https://trailhead.salesforce.com/modules/alm_deployment/ units/alm_intro ◇ Learn More About Sandboxes: https://trailhead.salesforce.com/modules/alm_deployment/units/ alm_sandbox
  • 59. #tahoedreamin18 Resources ● Process Limits: https://help.salesforce.com/articleView?id=process_limits.htm&type=5 ● Order of Execution: https://developer.salesforce.com/docs/atlas.en- us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm ● Deploying Flows https://help.salesforce.com/articleView?id=process_changesets_packaging.htm& type=5
  • 60. #tahoedreamin18 Thanks! Q&A - Any questions? Connect with us: ◇ @meighanSF | meighanrockssf@gmail.com ◇ @stangomat | daniel.stange@die-interaktiven.de ◇ Slides at http://bit.ly/untilitbreaks
  • 61. #tahoedreamin18 Addendum ● BlueCanvas.io can really do metadata backup. They emailed me on my remark in the session. Check https://bluecanvas.io/2017/04/18/salesforce- disaster-recovery.html ● Automated testing: Provar is a full scale solution. Coders should consider including Nightwatch JS in their build scripts ● If you feel comfortable with the command line, you have to try out the Salesforce CLI that comes with the Salesforce DX installation ● https://developer.salesforce.com/docs/atlas.en- us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
  • 62. #tahoedreamin18 Blogpost to come ● http://blog.danielstange.de/2018/01/20/tahoedreamin18/

Editor's Notes

  1. Guide towards the topic. Inquire, who works within a guided process Ask for bad expience etc.
  2. Hands up who knows this. And hands up who pushed something like that to prod It’s not about fingerpointing - we all did (and do) that in emergencies or when in hurry. But we have to do better and clean up as soon as possible
  3. What do we mean by enterprise patterns? It basically describes a process that reduces random or unpredictable results and therefore reduces risk for the org’s health and data integrity. Enterprise patterns basically means: Establish a workflow, make steps compliant and follow best practice in terms of quality, engineering and security standards. Then adhere to it and track that you’re following this process. Take the standards that you expect from enterprise grade software development and use them in your declarative customizations
  4. The most important pattern is establishing a routine for handling changes. This starts with the way you collect change requests: Let users give you some explanation - commonly refered to as a “user story” (As <role> I need <feature> so that <task/problem to solve>. The more crucial part we want to stress here is the way HOW you do changes. While Salesforce gives you the ability to change almost everything straight in production, this doesn’t mean you should work that way. If you look a little closer, Salesforce even warns you to make any changes directly in production. You might have heard this already, but a core principle to reduce or avoid an unpredictable state of your org and logic, and therefore a number one advice if you decided to treat declarative changes in the same way you treat enterprise software development: Don’t develop in your production org (except reports, dashboards and list views), don’t have even have more than a few people with the permission to bring in changes. Establish a role for this job, take care to select experienced people for this role and make sure they understand that they are the keepers of your org.
  5. It’s not about being perfect right from the beginning. If you didn’t document right from the beginning, you will have a hard time to “fretro-document” everything. Yet it is overly important that you keep your knowledge about the org somewhere accessible. Have you ever “inherited” an org? <Ask the audience> Did you find at least some documentation? In an ideal world, you will create an index of all object and all logic, that explains - most importabnt - the ideas and rationale - THE WHY - behind customizations. The world is not ideal - we know that. Make a humble start: Try to write down - at least for your new customization - why you did it and what you did. Whenever you touch something, make it a habit to write this kind of documentation for something that’s already there. You will see that very soon, a nice compendium to refer to will be around.
  6. Whatever you do, it should be consistent. The API names are indeed very relevant, so is your data model. Not to mention layout - users, admins, coders --- they all rely on you to build consistent patterns that the can adapt to
  7. Building declaratively means bringing powerful tools in the hands of literally everyone who can customize the application. Keep things simple, and that also means that you might prefer old school WFR over PB
  8. Even though you often test by single records, always remember that everytning needs to work as well when a data import pushes 1000s of records in chunks of 200
  9. Its important to know that everything is in a good shape before you start. There, run all local Apex Unit Tests before you start developing. Choose running local tests so that everything that run everything that i’s what creates your test coverage. No use running all unit tests because these include managed package tests - you can’t resolve errors and salesforce doesnt count them into your test coverage. If tests fail - keep a log. It’s not good and you should seek to resolve test failures. But a lok will help you and your team to identify the person / team to fix the issue. Expect these failures to happen upon your deployment too.
  10. Its important to know that everything is in a good shape before you start. There, run all local Apex Unit Tests before you start developing. Choose running local tests so that everything that run everything that i’s what creates your test coverage. No use running all unit tests because these include managed package tests - you can’t resolve errors and salesforce doesnt count them into your test coverage. If tests fail - keep a log. It’s not good and you should seek to resolve test failures. But a lok will help you and your team to identify the person / team to fix the issue. Expect these failures to happen upon your deployment too.
  11. Not so fast.
  12. It’s time to complete your documentation. Does your solution match the requirements? Does is satisfy acceptance criteria?
  13. Does the logic work as described? (you did document the design, right?) Are all acceptance criteria satisfied? (you did write that down, too, right?) Does the logic affect you when you’re doing unrelated things? (well, too bad then. start over and build better entry criteria)
  14. Running Apex unit tests is essential in testing. Lots of declarative changes can backfire and break Apex code. You don't want to learn about it in Production
  15. Even though you cant build real "unit" tests, you can pick any ETL tool and run bulk test by inserting, updating, deleting and undeleting records and verify the results.
  16. Only if you're sure that your developments meet your standards and match acceptance criteria, migrate to UAT and bring users in
  17. Use off-peak hours and days Communication is key No surprises Allow people No pre-weekend, pre-holidays, last-hour-of-the-day exercises
  18. Realistic scenarios – real user Authentic pre-built data – but masquerade personal data, esp. Emails Chatter group & Files / Libraries for end user documentation and training (recorded sessions, manuals, cheat sheets etc.)
  19. Step-Number and/or Order of Steps Manual PRE-deployment tasks Deployment tasks Components (Metadata Type, Object, Name/Label, API-Name) Manual POST-deployment tasks
  20. Create a fresh Sandbox off Production as a metadata backup Use your favorite ETL tool for a data backup
  21. Create a fresh Sandbox off Production as a dummy target Send your changeset and walk through your deployment document
  22. There are limits to Metadata types that can be deployed Changeset deployments through a deployment path are tedious and prone to errors like missing components etc. Browser extensions can support the process Metadata API is the preferable way Lots of free tools (DX and Ant Tool) and paid ones (Gearset, AutoRabit, Flosum, Copado)
  23. Keep in mind that processes deploy in inactive state. You have to activate them and seriously should run Apex unit tests again. You don‘t see that damage in deployment tests
  24. Does the logic work as descibed? (you did document the design, right?) Are all acceptance criteria satisfied? (you did write that down, too, right?) Does the logic affect you when you’re doing unrelated things? (well, too bad then. start over and build better entry criteria)
  25. Relevant Salesforce Help / Documentation
  26. Relevant Salesforce Help / Documentation
  27. Relevant Salesforce Help / Documentation