Rules-based Record Generation
with Custom Metadata Types
Daniel Peter
🌵 Salesforce Practice Lead, Robots & Pencils
🌵 Salesforce MVP
🌵 Bay Area Salesforce Developer Group Leader
🌵 27x Certified
🌵 @danieljpeter
Thank You Sponsors!
SAGUARO
AGAVE
OCOTILLO
CHOLLA
Thank You Attendees!
Thank You Organizers & Volunteers!
Hierarchy of takeaways
7
Concrete Example
Concept
Architect
Mindset
Concrete Example
In Salesforce how can I build something on
opportunities to help me pay bonuses to my
Sales Reps?
They all get different bonuses for different
things, and it’s always changing.
Concept
Using Custom Metadata Types you can
define a rule set to split, clone, transform
values on any object to create records in a
child object for various use cases.
Architect Mindset
Simple
Future Proof
Maintainable by the end user
Self-Documenting
Scalable
Performant
Secure
Sales Bonus Rules
DanCactus Jack
1 year, 1% 10 years, 10%
Before 2020: $500
After 2020: $1000 / Large opps
DEMO
Data, metadata?
Separation of concerns
In computer science, separation of
concerns (SoC) is a design
principle for separating a computer
program into distinct sections such
that each section addresses a
separate concern.
https://en.wikipedia.org/wiki/Separation_of_concerns
Salesforce Object (Opportunity)
field
Salesforce Platform
Workflow Process Builder Apex
Formula fields
Future feature?
Evergreen?
CMDT (Sales Bonus Rules) Sales Bonus Service (Apex)
Salesforce Object (Sales Bonus)
Solution Summary
🌵 Generates records based on field values on
other objects, and CMDT definitions.
🌵 Data integrity upserting with Unique Key
🌵 Sharing model decoupling
🌵 Self documenting
🌵 Active / start /end date
🌵 Maintainable by configuration
🌵 Has an escape hatch (Apex)
thanks!
Any questions?
21

Rules-based Record Generation with Custom Metadata Types