O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Force Academy '19: I fell in love with clicks AND code - here's what I learned in relationship therapy

512 visualizações

Publicada em

Presentation held at ForceAcademy '19 (May 13, 2019). Session Abstract: The Lightning platform enables both Admins and Developers to build customized logic in ways that no other platform offers. Flows, processes, workflows and Apex code can sit side-by-side to accelerate even the most complex business processes.

Let's face it: In a fresh org, you can easily build with "Clicks Not Code". But how do you learn to align legacy code and new declarative customization’s to design reliable and scalable application with Clicks AND Code?

I will run you through typical scenarios and show where (and how) Code and Clicks work together harmonically. And as this relationship sometimes get complicated, I will bring a few scenarios where our clicks AND code couple clashes - let's stick our heads together to apply some best practice and patterns as a therapy!

Publicada em: Tecnologia
  • You can try to use this service ⇒ www.HelpWriting.net ⇐ I have used it several times in college and was absolutely satisfied with the result.
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • Seja a primeira pessoa a gostar disto

Force Academy '19: I fell in love with clicks AND code - here's what I learned in relationship therapy

  1. 1. #ForceAcademyLA I fell in love with clicks AND code … here’s what I learned in relationship therapy
  2. 2. #ForceAcademyLA Thank you Sponsors! A big shout out to our sponsors, without them these events would not be possible:
  3. 3. #ForceAcademyLA#ForceAcademyLA Hello! Daniel Stange Technical Architect DIA die.interaktiven Frankfurt (DE) User Group Leader Found Salesforce boring in the dark ages - Changed my mind. You can find me at: @stangomat linkedin.com/in/danielstange/ Blog: blog.danielstange.de
  4. 4. #ForceAcademyLA#ForceAcademyLA • Happy (Solo) Days • Relationship <3 • Crisis! • Reconciliation Agenda
  5. 5. #ForceAcademyLA “Do not swear by the moon, for she changes constantly. then your love would also change.”
  6. 6. #ForceAcademyLA Solo Admin, flyin’ solo 1. HAPPY DAYS
  7. 7. #ForceAcademyLA#ForceAcademyLA DEMO Our session scenario: Just a plain org with some basic “clicks not code” automations Place your screenshot here
  8. 8. #ForceAcademyLA Wouldn‘t it be nice if it never rained?
  9. 9. #ForceAcademyLA#ForceAcademyLA Which scenarios were tested? There aren‘t any issues, right? How was it tested? For which scale was it built? Operation Types Data Volume
  10. 10. #ForceAcademyLA Admin <3 Dev kinda… 2. RELATIONSHIP
  11. 11. #ForceAcademyLA#ForceAcademyLA • Apex Developers • AppExchange Packages • Integrations & Data Loads • ... and even yourself (yes, that‘s right) Who‘s in the game?
  12. 12. #ForceAcademyLA#ForceAcademyLA Scenarios? Again... Tests? Scale? Operations? Data Volume? Single record, positive tests from the UI with an Admin user...
  13. 13. #ForceAcademyLA#ForceAcademyLA DEMO A new requirement! And alas – it needs some code! Place your screenshot here
  14. 14. #ForceAcademyLA “Thus with a kiss I die”
  15. 15. #ForceAcademyLA „Just don‘t send these kinds of emails!“ 3. CRISIS
  16. 16. #ForceAcademyLA#ForceAcademyLA DEMO Turns out that declarative and code don’t live side by side harmonically… But why? And What can we do? Place your screenshot here
  17. 17. #ForceAcademyLA#ForceAcademyLA • „it‘s nothing personal“ indeed: Exceptions pop up as they happen • Team up • Keep documentation (of the system AND of incidents) Cope with Anger & Frustration
  18. 18. #ForceAcademyLA#ForceAcademyLA LIMITS Bring the attention of your audience over a key concept using icons or illustrations
  19. 19. #ForceAcademyLA Everyone shares the same set of limits Even workflow rules consume governor limits. Database interactions, rows... And CPU time! KNOW ABOUT THE LIMITS
  20. 20. #ForceAcademyLA#ForceAcademyLA ORDER There’s an order to everything that happens after you saved a record to the database
  21. 21. #ForceAcademyLA#ForceAcademyLA Know the „Order of Execution“ by heart Þ Core explanation for most common problems Þ Logic may not run (or run more than once) Þ Data may have changed Þ Inspect the operation flow in the dev console using the „Analysis Perspective“
  22. 22. #ForceAcademyLA#ForceAcademyLA „Order of Execution“ at a glance
  23. 23. #ForceAcademyLA#ForceAcademyLA „Order of Execution“ at a glance
  24. 24. #ForceAcademyLA#ForceAcademyLA „Order of Execution“ at a glance
  25. 25. #ForceAcademyLA#ForceAcademyLA RECURSION Re-Entry into previously executed logic is sometimes crucial – and sometimes terribly dangerous
  26. 26. #ForceAcademyLA#ForceAcademyLA Operations can (and will) run in circles Recursion is the #1 villain... Really. Use the recursion flags for Workflows and process Builder with care Map out your operations
  27. 27. #ForceAcademyLA#ForceAcademyLA SPREAD A Change in Data can trigger a chain reaction as it fires logic far away from the starting point
  28. 28. #ForceAcademyLA#ForceAcademyLA Operations tend to spread out Plan automations carefully if they are going to touch related objects and keep documentation / maps.
  29. 29. #ForceAcademyLA#ForceAcademyLA The Usual Suspects... • Rollup Summaries • Cross Object Workflow Updates • Implicit Rollups • (Task to LastActivityDate on Account and WhoId / WhatID) • DLRS / Rollup Helper
  30. 30. #ForceAcademyLA#ForceAcademyLA DEMO Supposedly simple operations can consume a massive amount of your limits Place your screenshot here
  31. 31. #ForceAcademyLA They lived happily Ever after 4. RECONCILIATION
  32. 32. #ForceAcademyLA#ForceAcademyLA CHOOSE WISELY Know when to build code, know when to save the effort
  33. 33. #ForceAcademyLA#ForceAcademyLA • Avoid PB / Flow for bulk operations • Use the advantage of the „before“ context in Triggers • Use „update records“ action with care if writing up or down • Minimize the number of automation types and stick with one Rule of thumb: Least complex tool to do the job
  34. 34. #ForceAcademyLA#ForceAcademyLA BE SPECIFIC For every automation, check for the conditions to really run the automation
  35. 35. #ForceAcademyLA#ForceAcademyLA • Leverage entry criteria • Leverage action criteria in Process Builder • Check for Changed Fields before running your logic Filter for exact scenarios
  36. 36. #ForceAcademyLA#ForceAcademyLA USE GATES Filter away everything that should not happen
  37. 37. #ForceAcademyLA#ForceAcademyLA • Use hidden fields to start or bypass workflows, flows and process builder nodes Flow Control in Declarative Logic
  38. 38. #ForceAcademyLA#ForceAcademyLA Static variables to keep track of • Operation Entry Point • Executed Units • Processed Record Ids • Units to execute (or not) Advanced stuff: Enterprise Patterns / Unit of Work Flow Control in Apex Triggers
  39. 39. #ForceAcademyLA#ForceAcademyLA DEMO Use clear entry conditions and prevent re-entry Place your screenshot here
  40. 40. #ForceAcademyLA#ForceAcademyLA ALLOW BYPASSES Once you control your automations, build ways to bypass your logic
  41. 41. #ForceAcademyLA#ForceAcademyLA Bypasses let you decide which logic to run next. • Exceptions from Validations • Deliberately bypass logic KNOW WHAT YOU‘RE DOING: Data Inconsistency Ahead! Bypasses to manipulate the flow
  42. 42. #ForceAcademyLA#ForceAcademyLA DEMO Use a Custom Permission to Bypass Validations Place your screenshot here
  43. 43. #ForceAcademyLA#ForceAcademyLA DEMO Use Handler bypasses in Triggers Place your screenshot here
  44. 44. #ForceAcademyLA#ForceAcademyLA The Work Horse: Kevin O‘Hara‘s Framework: github.com/kevinohara80/sfdc-trigger-framework Lightweight & Modern: MyTriggers: github.com/appero-com/MyTriggers Full Circle: Force DI: github.com/afawcett/force-di Trigger Handler Progression
  45. 45. #ForceAcademyLA#ForceAcademyLA TEST, TEST, TEST… volume, integrations, expected outcome,
  46. 46. #ForceAcademyLA#ForceAcademyLA DEMO Example of a test data insert, update extract and delete job. Place your screenshot here
  47. 47. #ForceAcademyLA#ForceAcademyLA Thank Y u! Any questions? You can find me at: @stangomat Daniel.Stange@die-interaktiven.de linkedin.com/in/danielstange/ Blog post / source code to come blog.danielstange.de and github.com/dstdia