Trailblazer DX - 2023
Some notes on the sessions from the Trailblazer DX conference in San Fransisco, CA in March 2023.
Keynote
- Einstein GPT
- Takes in customer data
- Use Salesforce Model, your model, or any other model
- Einstein Assistant - Chat inside of Sales Cloud that you can use to ask different questions about your customers, including public data
- Can be embedded in Slack
- Can be embedded in Tableau
- Can be used in Service Cloud for assistance in Chat sessions
- Also available in VS Code like a “GitHub Copilot”-like feature
- Data Cloud
- Foundation of the correct means for getting AI to work for you
- If your data is bad, your AI will be bad
- DataLake Object
- Can store trillions of records
- Can create thousands of these types of objects
- Data Pipelines: The ETL tool (“no ETL?”) for Data Cloud
- Foundation of the correct means for getting AI to work for you
- Flow Updates
- HTTP Callouts in Flows
- Case Classification Flows
- Mulesoft Composer + Flow for pre-built actions
- Reactive Flow Components
- Enhanced Screen flow components
- Flow Orchestration on Mobile
- Slack - GA in Summer ‘23
- Workflow builder
Apex Best Practices
- Consider using Platform Cache for speeding up long-running processes
- Platform Event delivery is not guaranteed - Consider moving certain client workflows to centralized Async handlers
- Though in this next year we’ll have the ability to pass a callback class that will be executed upon successful or failed attempts to publish an event to the bus
DataWeave
- Functional programming language for use in processing records of one type and going into another type
- Created by MuleSoft
- Language / CLI can be downloaded and is open source
- VS Code extension allows for testing DW scripts with samples
- Could be used for loading large amounts of data via Apex
- Can call to a DW script, passing in data from Apex
- Can output SObjects
- Should be able to deploy DW scripts as part of the metadata api and store / invoke them in SFDC
CumulousCI Suite
- Problems that it solves:
- Reduces Org Setup Cost
- Improves Org Reliability
- Helps with conflicts
- Helps to bootstrap orgs for development
- Steps to use it
- Document exactly what you need in order to test and develop in the platform
- Get exact steps as a setup guide
- Take those steps and convert them to tasks in a YAML file that CumulusCI can ingest and run
- Document exactly what you need in order to test and develop in the platform
- Tons of steps are pre-built and can be leveraged
- Can work by creating scratch orgs, or can be used in a new Dev sandbox
- Based on SFDX
- Free and OSS
- MetaDeploy
- Just like CCI CLI but in a web-based platform
Resources
- Trailhead modules on CumulousCI
- sfdo-community-sprints.github.io
Slack Keynote
- ChatGPT app inside of slack
- Beta open Today
- Use Cases
- Summarize threads / channels
- DM it for answering questions, about public information or information found in Slack
- Draft messages
- Screen Flows can be run in Slack
2GP Packaging Updates
- Benefits of 2GP
- Source-driving development
- API/CLI-first deployment model
- Multiple packages per namespace
- Make sure you use
namespace accessiblefor your Apex
- Make sure you use
- Flexible versioning model
- Declarative dependencies
- Super-simple Patch Versioning
- 2023 Focus Areas
- Making packaging operations faster
- Enable everyone to move to 2GP by delivering on Package Migrations
- Package Performance Roadmap
- See picture that I took of the roadmap
- Package Migrations (not GA yet)
- Fully dedicated team to this effort
- Package Conversion vs. Migration
- Conversion: Convert 1GP package to 2GP
force:package:convert
- Migration: Subscribers are migrated to 2GP version from 1GP version
- Conversion: Convert 1GP package to 2GP
- What does this look like when GA? See picture that I took of process
- What does Conversion look like before GA?
- Developer preview open to all partners available today
- Roadmap: See the picture that I took of the roadmap
- How to sign up and get more documentation? See the picture I took of the signup slide
- Main takeaways
- Realistically it’s looking like full 1GP -> 2GP packaging won’t be available till at least Spring ‘24, so for Zingtree we just need to focus on tightening up on deployment automations / using CCI for better controls while continuing to use 1GP
- Should still plan on using 2GP tools for Zingtree like Scratch Orgs, CLI, code, etc…
- I need to write up SLDC for working on Managed Packages
AI Code Generation w/ CodeGen & Einstein
- Ananya is the PM for IDE interactions
- Main pain points today
- See compilation errors without having to deploy Apex
- Code profiling is limited and difficult
- Too much Boilerplate to create, and lack of tools to auto-generate
- LLM used: CodeGen
- 16B parameters
- Largest Open Source LLM for Code
- Einstein GPT for Devs and Admins
- Can generate code
- Github Copilot-like experience
- Can also have chat interface directly in VS Code to chat more about code
- Can generate flows?
- Can generate code
- Replit’s GhostWriter built on CodeGen
- Roadmap
- Developer preview (I signed up, but don’t know really what that entails)
- Invite-only Pilot to hopefully come out at Dreamforce this year
- GA not even planned yet
Custom Property Editors in LWC
- Ability to create LWCs that would act as more customized property editors for another LWC
- See pics of slides
- Also there are more OOTB types for more rich types / properties
- Like Dates with a date picker
- See pics of slides
- Can create custom property types
- Defined in
experiencePropertyTypeBundlemetadata type - Series of JSON files, using JSON Schema formatting
- Includes validation and display rules
- See pics of slides
- Defined in
- Can use Accordions or Tabs for better organization of properties for an LWC
- See pics of slides
- Roadmap
- Available as a dev preview for Experience Cloud sites
- Summer ‘23 - 2GP Packaging Support
- Winter ‘24 - Experience Builder GA
- Spring ‘24 - Conditional Properties / Lightning App Builder Dev Preview
Async vs. Sync Architectures
- Record-Triggered Flows can have an async path
- Limit Tracking
- Apex and Flows track Async processing (250k maximum) the same, but independently
- Remember that you should design the architecture to allow for things to fail and not be run
- Usually async actions won’t run immediately: be prepared for 20mins of latency of Async processing on a bad day
- Especially when you’re running async processes, really consider error handling and logging frameworks
- General recommendations / last thoughts
- Don’t overuse Batch Apex, there are a lot of downsides if you don’t use it for its appropriate use case
- Queueuable Apex is much better than
@futuremethods; don’t bother using them any more - Use Async Record-triggered flows instead of 0-wait pause elements
- Make sure you follow the correct order of general actions in async flows
- Fetch all records
- Callouts to external systems
- Prepare records
- CUD on records in the database
- Check out “Rollback Node” in Flow for longer Screen flows with more advanced transaction management
DevOps Center + CLI
- DevOps Center can be great for teams that are hybrid (programmatic and declarative developers)
- DOC will keep track of all changes made to branches and show them in an easy-to-digest format
- For programmatic developers, you don’t really have to work in DevOps center, you just need to start the work item from DevOps center
- It’ll create a new feature branch for you, and then you can get started using VS Code and git / Github
- “Environments Out of Sync” - What you’ll see when merging via Github. Basically means that it’s in the branch but not in the actual org
- Could have Github action that auto-deploys on merge to a branch
Random Learnings from Booths
VS Code Booth
- Use the Apex replay debugger, it’s SO much better than using
System.debug()statements - They’re easy to use, and don’t require any other org setup, just set a checkpoint and run it
- Difference between breakpoints vs. checkpoints
- Use checkpoints instead
- Limited to 5 checkpoints at any given time across your org
LWC Booth
CLI Booth
sfCLI is already installed withsfdxCLI- Can start using it if we want, no big rush right now
API Booth
- Use the Composite API (tree api) for creating records with nesting
- SOQL will allow for sub queries up to 5 levels deep soon (within the next release or so)
- Eventually (date TBD) there will be friendly URLs that allow for querying data across relationships, up to 5 levels deep
- Ex.
/v55.0/data/Account/001a32jfasldkjdsf/Contacts/003afjssdfljk23sflkjds9f/Cases/...
- Ex.
Future of Apex
- Session of the Apex roadmap
- See picture of the roadmap
WITH USER MODE- Better version ofWITH SECURITY ENFORCED- DataWeave support with Apex
- In a future release,
Setwill implementIterableinterface
Security
- Apex runs in System Mode
- Can do whatever the highest privilege user in that org can do, full stop
stripInaccessible()- See pic of slide
- Still a really good thing to use
WITH SECURITY_ENFORCED- didn’t age well- Can only do FLS/CRUD checks
- Can’t work with restriction rules
- Doesn’t apply to WHERE clause
- Doesn’t work well with polymorphic lookups
- Will likely be version this out
- User-Mode DB Ops - Available as of Spring ‘23
- See pics of slides
- CRUD as users
insert as user- Legitimately forces Apex to drop out of System mode directly into User mode, and then runs DB operations, then comes back when done
- Will scale much better as the platform evolves
- User-Mode DB Ops Future
- Allow for Developer-based Permission Sets that allow for User-Mode + additional permission sets
- User doesn’t need to have permission set applied
- See pics of slide for potential syntax, though could change
- Potentially coming before EOY
- Allow for Developer-based Permission Sets that allow for User-Mode + additional permission sets
Quality of Life (DX)
- Dynamic Bind Variables in SOQL (See slide for example)
- Label translation - GA in Summer ‘23
- Apex-based Sorting to become easier - No date yet
- Interface Implementer Discovery - GA now
- Used largely for dynamic code generation, searching for all Apex classes that conform to an interface
- I believe that this would be a good replacement for the Custom Metadata-driven centralized Trigger or Async frameworks shown in Advanced Apex Programming
Async Updates
- Controlling the job rate of Queueable Apex- GA now
- Define a delay in when you’d like your Queueable job to run, up to 10 minutes
- Can also choose to use 0 minutes as the option, meaning run as fast as possible
- Be careful with this
- Ability to have more dynamic chained job protection (for when you’re in a dev org, e.g.) - Coming Soon
- See slide for example, but syntax could change
- Deduplication control - Coming Later
- Allow for setting a “Deduplication Key” when you enqueue a Queueable job to avoid from people enqueueing the same job accidentally
- See Slide for example
- Extended Query Locators - Coming Later
- Allows for Queueable to be similar to Batch Apex in pagination without a bunch of pagination custom logic
- Would like to basically allow for Queueable to replace Batch Apex in the future
- See slide for example syntax, though could change before GA
DataWeave and Apex
- Coming in Summer ‘23 as a Beta
- But it’s available everywhere now!
- DON’T need to be a MuleSoft customer to use DataWeave in Apex
Generics in Apex
- Why?
- To add better tools for dealing with bulkification / performance tuning of your Apex
- Coming in the future, no date specifically available
- Still gathering feedback on how to implement based on use cases and needs