SlideShare a Scribd company logo
1 of 26
Salesforce Admin Group, Trichy
Low Code Love: Salesforce
Automation Tool vs Apex Code
Kadhar Basha J
Salesforce Admin Group, Trichy
Trailblazer Community Group Leader
MST Solutions
Sundaravel J
Salesforce Admin Group, Trichy
Trailblazer Community Group Co-Leader
MST Solutions
Salesforce Admin Group, Trichy
Salesforce Admin Group, Trichy
Speaker
Kadhar Basha J
MST Solutions
Salesforce Admin Group, Trichy
• Meetup Success
• Public Interest
• Social Media promotions
• Leader contribution
• Previous meetups
• Achievement
• Admin path
Today’s Agenda
• What is a Roll-Up summary Field?
• What is the necessity of automation?
• What all are the limitations of Roll-Up
• What alternative solutions do we have?
• Demo
• Questions & Answers
• Conclusion
What is a Roll-Up summary Field?Logo
• Roll-up summary is a built-in functionality in Salesforce. They allow
you to create Sums, Counts, and more for objects that share a Master-
Detail relationship.
• Cannot use Roll-Up Summary fields to create a Sum or Count for
objects related with a Lookup field
• The Roll-up field automatically looks for the change in related records
and automatically updates the Master record.
Continued…Logo
• This can be created only when the relationship between Parent
and child is ‘Master-Detail’ Relation.
ExampleLogo
we have ‘Admin’ object, which his having a ‘Trichy’ as Child
Object. We can calculate the number of child objects exists
for the ‘Admin’ and display them in the ‘Admin’ object.
When a new ‘Trichy’ is added, the roll-up summary field in
‘Admin’ is updated automatically.
Schema DescriptionLogo
What is the necessity of automation?Logo
There are two more options to create a roll-up field without MD
relationship.
• Apex code
• Automation process
Why we choose Automation over apex code?
We can integrate different Automation tools like Process Builder and
Auto launched Flow to perform a complex process and can even call
Apex code from the tools. In short, they have made the jobs of
Salesforce Administrators easier.
Automation TypesLogo
Automation process has
divided into four different
types based on the
functionality
• Workflow
• Process Builder
• Approval Process
• Flow Builder
What all are the limitations of Roll-Up summary fieldLogo
• A Roll-up summary can be created only on records which are having
Master-Detail Relationship.
• A Master-detail relationship can’t be changed to lookup relationship
after creating a roll-up summary field on an object.
• When you refer to a roll-up summary field in a list view or report, you
can’t use certain qualifiers, including: Starts with Contains, Does not
contain, Includes, Excludes and Within.
What alternative solutions do we have?Logo
Now we can be able to create a Sum, Count, Min and Max field to
populate values on objects that do not share a Master-Detail
relationship using either Automation or Developing concepts
• Apex/Trigger
• Flow/Process Builder
Screen Flow
Auto-Launched Flow(Flow with Process Builder)
Triggered Flow
Lightning Scheduler Flow
Apex TriggerLogo
trigger ApexRollUpSummaryTrigger on Trichy__c (after insert, after update, after delete, after undelete)
{
if (trigger.isAfter && (trigger.isInsert || trigger.isUpdate || trigger.isUndelete))
{
ApexRollUpSummary.sumofMembers(trigger.new);
}
else if (trigger.isAfter && trigger.isDelete)
{
ApexRollUpSummary.sumofMembers(trigger.old);
}
}
Apex ClassLogo
public class ApexRollUpSummary
{
public static void sumofMembers(list<Trichy__c> lstOfMembers)
{
Set<Id> adminIds = new Set<Id>();
List<Admin__c> updLstOfAdm = new List<Admin__c>();
List<Trichy__c> memberList = new List<Trichy__c>();
for(Trichy__c trichy : lstOfMembers)
{
if(trichy.Admin__c != null)
adminIds.add(trichy.Admin__c);
}
ContinuationLogo
List<Admin__c> lstAdm = [SELECT Id,Name,Total_Members__c, (SELECT
Id,Group_Members__c FROM Trichys__r) FROM Admin__c WHERE Id IN : adminIds];
for(Admin__c adm : lstAdm)
{
decimal total = 0;
if(adm.Trichys__r.size() >0)
for(Trichy__c tcy : adm.Trichys__r)
{
if(tcy.Group_Members__c != null)
total = total+tcy.Group_Members__c;
ContinuationLogo
}
adm.Total_Members__c = total;
updLstOfAdm.add(adm);
}
if(updLstOfAdm.size() > 0)
{
update updLstOfAdm;
}
}
}
Auto-Launched FlowLogo
Triggered FlowLogo
Triggered FlowLogo
Challenges in ApexLogo
• Need to maintain all the insert and update events in a single
trigger for a single object (As part of best practice)
• Need to have handler logic in separate apex class.
• Mandatorily should write apex test class and have test
coverage of above 75% for and every class.
• Test class should cover positive, negative and bulk scenarios
(As part of best practice).
• Need to have trigger switch in order to turn it off in
production.
Launch
DEMO
Any
Questions
so
far
Conclusion
• Sometimes Apex code also depend on Automation process
• New version of Flow contains all those options which is available after
wrote a huge lines of code in Apex.
• Initially process builder doesn’t have “Delete” option but that would be
overcome by Flow builder
• As a Low Code Lover, I would suggest to go with Automation
Word Quiz
Low code love salesforce automation tool vs apex code

More Related Content

What's hot

MS Dynamics CRM 2011 Technical
MS Dynamics CRM 2011 TechnicalMS Dynamics CRM 2011 Technical
MS Dynamics CRM 2011 Technical
AnilCSlides
 
Introduction to apex code
Introduction to apex codeIntroduction to apex code
Introduction to apex code
EdwinOstos
 
Salesforce Traning Adm 201
Salesforce Traning   Adm 201Salesforce Traning   Adm 201
Salesforce Traning Adm 201
plug2learn
 

What's hot (20)

Vf ppt (1)
Vf ppt (1)Vf ppt (1)
Vf ppt (1)
 
Singapore Admin Group - 5 Free Admin Tools to Make Your Life Easier
Singapore Admin Group - 5 Free Admin Tools to Make Your Life EasierSingapore Admin Group - 5 Free Admin Tools to Make Your Life Easier
Singapore Admin Group - 5 Free Admin Tools to Make Your Life Easier
 
Admin community meetup admin secrets to clear salesforce interview (1)
Admin community meetup   admin secrets to clear salesforce interview (1)Admin community meetup   admin secrets to clear salesforce interview (1)
Admin community meetup admin secrets to clear salesforce interview (1)
 
Salesforce Basic Development
Salesforce Basic DevelopmentSalesforce Basic Development
Salesforce Basic Development
 
Salesforce Developer Console ppt
Salesforce Developer Console  pptSalesforce Developer Console  ppt
Salesforce Developer Console ppt
 
5 free admin tools to make your life easier - Tel Aviv, Israel Admin Group
5 free admin tools  to make your life easier - Tel Aviv, Israel Admin Group5 free admin tools  to make your life easier - Tel Aviv, Israel Admin Group
5 free admin tools to make your life easier - Tel Aviv, Israel Admin Group
 
Visual Workflow Overview
Visual Workflow OverviewVisual Workflow Overview
Visual Workflow Overview
 
MS Dynamics CRM 2011 Technical
MS Dynamics CRM 2011 TechnicalMS Dynamics CRM 2011 Technical
MS Dynamics CRM 2011 Technical
 
Introduction to apex code
Introduction to apex codeIntroduction to apex code
Introduction to apex code
 
Practical Headless Flow Examples
Practical Headless Flow ExamplesPractical Headless Flow Examples
Practical Headless Flow Examples
 
SharePoint 2016 Platform Adoption Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Platform Adoption   Lessons Learned and Advanced TroubleshootingSharePoint 2016 Platform Adoption   Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Platform Adoption Lessons Learned and Advanced Troubleshooting
 
Salesforce Traning Adm 201
Salesforce Traning   Adm 201Salesforce Traning   Adm 201
Salesforce Traning Adm 201
 
SharePoint 2013: Using Client-Side Rendering to color-code list cells
SharePoint 2013: Using Client-Side Rendering to color-code list cellsSharePoint 2013: Using Client-Side Rendering to color-code list cells
SharePoint 2013: Using Client-Side Rendering to color-code list cells
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
 
Intro to salesforce platform for developers
Intro to salesforce platform for developersIntro to salesforce platform for developers
Intro to salesforce platform for developers
 
Custom Automation Masterclass – Workshop 2: Email validation using kKckbox
Custom Automation Masterclass – Workshop 2: Email validation using kKckboxCustom Automation Masterclass – Workshop 2: Email validation using kKckbox
Custom Automation Masterclass – Workshop 2: Email validation using kKckbox
 
Cloud flow designer: Salesforce.com
Cloud flow designer: Salesforce.comCloud flow designer: Salesforce.com
Cloud flow designer: Salesforce.com
 
oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...oracle oa framework training | oracle oa framework training courses | oa fram...
oracle oa framework training | oracle oa framework training courses | oa fram...
 
Oracle application framework (oaf) online training
Oracle application framework (oaf) online trainingOracle application framework (oaf) online training
Oracle application framework (oaf) online training
 
Nw2004s What Is New
Nw2004s What Is NewNw2004s What Is New
Nw2004s What Is New
 

Similar to Low code love salesforce automation tool vs apex code

Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
Atul Chhoda
 
Orcl Crmod Vs Sfdc Reporting And Analytics
Orcl Crmod Vs Sfdc Reporting And AnalyticsOrcl Crmod Vs Sfdc Reporting And Analytics
Orcl Crmod Vs Sfdc Reporting And Analytics
Shane_Boyd
 
Analytics: CRM On Demand vs SFDC
Analytics: CRM On Demand vs SFDCAnalytics: CRM On Demand vs SFDC
Analytics: CRM On Demand vs SFDC
lnbeck
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and Apex
Salesforce Developers
 

Similar to Low code love salesforce automation tool vs apex code (20)

Programming Building Blocks for Admins
Programming Building Blocks for Admins Programming Building Blocks for Admins
Programming Building Blocks for Admins
 
bmarshall teaching Calculation Manager on prem
bmarshall teaching Calculation Manager on prembmarshall teaching Calculation Manager on prem
bmarshall teaching Calculation Manager on prem
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
TrailblazerDX Motihari.pptx
TrailblazerDX Motihari.pptxTrailblazerDX Motihari.pptx
TrailblazerDX Motihari.pptx
 
Welcome Webinar Slides
Welcome Webinar SlidesWelcome Webinar Slides
Welcome Webinar Slides
 
TFS session
TFS sessionTFS session
TFS session
 
Tfs session
Tfs sessionTfs session
Tfs session
 
Salesforce interview questions walkthrough
Salesforce interview questions walkthroughSalesforce interview questions walkthrough
Salesforce interview questions walkthrough
 
Alternate for scheduled apex using flow builder
Alternate for scheduled apex using flow builderAlternate for scheduled apex using flow builder
Alternate for scheduled apex using flow builder
 
Looking under the hood of your org with eclipse
Looking under the hood of your org with eclipseLooking under the hood of your org with eclipse
Looking under the hood of your org with eclipse
 
Get ready for your platform developer i certification webinar
Get ready for your platform developer i certification   webinarGet ready for your platform developer i certification   webinar
Get ready for your platform developer i certification webinar
 
Dreamforce 2019 GG & Spring 20 release features - Halifax, Canada Community
Dreamforce 2019 GG & Spring 20 release features - Halifax, Canada CommunityDreamforce 2019 GG & Spring 20 release features - Halifax, Canada Community
Dreamforce 2019 GG & Spring 20 release features - Halifax, Canada Community
 
Orcl Crmod Vs Sfdc Reporting And Analytics
Orcl Crmod Vs Sfdc Reporting And AnalyticsOrcl Crmod Vs Sfdc Reporting And Analytics
Orcl Crmod Vs Sfdc Reporting And Analytics
 
Analytics: CRM On Demand vs SFDC
Analytics: CRM On Demand vs SFDCAnalytics: CRM On Demand vs SFDC
Analytics: CRM On Demand vs SFDC
 
CRMUG UK November 2015 - Data Migration Without Tears by Mike Feingold
CRMUG UK November 2015 - Data Migration Without Tears by Mike FeingoldCRMUG UK November 2015 - Data Migration Without Tears by Mike Feingold
CRMUG UK November 2015 - Data Migration Without Tears by Mike Feingold
 
Barcelona Salesforce Admins Group (7-May-2019)
Barcelona Salesforce Admins Group (7-May-2019)Barcelona Salesforce Admins Group (7-May-2019)
Barcelona Salesforce Admins Group (7-May-2019)
 
Salesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins Group
Salesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins GroupSalesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins Group
Salesforce Admin Group-Barcelona-2022-07-05 In-person Meetup-BCN Admins Group
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and Apex
 
165373293 sap-security-q
165373293 sap-security-q165373293 sap-security-q
165373293 sap-security-q
 

More from KadharBashaJ

A Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptxA Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptx
KadharBashaJ
 
Tour to docgen lightning experience
Tour to docgen lightning experienceTour to docgen lightning experience
Tour to docgen lightning experience
KadharBashaJ
 

More from KadharBashaJ (20)

A Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptxA Review on LWC Events for communication.pptx
A Review on LWC Events for communication.pptx
 
Winter'23 Release Updates.pptx
Winter'23 Release Updates.pptxWinter'23 Release Updates.pptx
Winter'23 Release Updates.pptx
 
Asynchronous Apex .pptx
Asynchronous Apex .pptxAsynchronous Apex .pptx
Asynchronous Apex .pptx
 
Review on Data Security.pptx
Review on Data Security.pptxReview on Data Security.pptx
Review on Data Security.pptx
 
Flow With Aura.pptx
Flow With Aura.pptxFlow With Aura.pptx
Flow With Aura.pptx
 
Conga composer
Conga composerConga composer
Conga composer
 
Flow builder series i
Flow builder series iFlow builder series i
Flow builder series i
 
Tour to docgen lightning experience
Tour to docgen lightning experienceTour to docgen lightning experience
Tour to docgen lightning experience
 
DocuSign Power Form
DocuSign Power FormDocuSign Power Form
DocuSign Power Form
 
Publish and subscribe platform events using flows
Publish and subscribe platform events using flowsPublish and subscribe platform events using flows
Publish and subscribe platform events using flows
 
Multi language support for salesforce community portal
Multi language support for salesforce community portalMulti language support for salesforce community portal
Multi language support for salesforce community portal
 
Simplified appointment scheduling using lightning scheduler
Simplified appointment scheduling using lightning schedulerSimplified appointment scheduling using lightning scheduler
Simplified appointment scheduling using lightning scheduler
 
Master tableau 20 in data science by solving real life analytics problems
Master tableau 20 in data science by solving real life analytics problemsMaster tableau 20 in data science by solving real life analytics problems
Master tableau 20 in data science by solving real life analytics problems
 
Qa mockup interview for automation testing
Qa mockup interview for automation testingQa mockup interview for automation testing
Qa mockup interview for automation testing
 
Qa mock up interview for manual testing
Qa mock up interview for manual testingQa mock up interview for manual testing
Qa mock up interview for manual testing
 
Docu sign integration with salesforce beginner learning series integration...
Docu sign integration with salesforce   beginner learning series  integration...Docu sign integration with salesforce   beginner learning series  integration...
Docu sign integration with salesforce beginner learning series integration...
 
Docu sign integration with salesforce beginner learning series setting up ...
Docu sign integration with salesforce   beginner learning series  setting up ...Docu sign integration with salesforce   beginner learning series  setting up ...
Docu sign integration with salesforce beginner learning series setting up ...
 
DocuSign Integration with Salesforce - Beginner Learning Series : Kick starti...
DocuSign Integration with Salesforce - Beginner Learning Series : Kick starti...DocuSign Integration with Salesforce - Beginner Learning Series : Kick starti...
DocuSign Integration with Salesforce - Beginner Learning Series : Kick starti...
 
How to reopen with intelligent predictions from tableau and einstein discovery
How to reopen with intelligent predictions from tableau and einstein discoveryHow to reopen with intelligent predictions from tableau and einstein discovery
How to reopen with intelligent predictions from tableau and einstein discovery
 
Unlock your data analytics with tableau
Unlock your data analytics with tableauUnlock your data analytics with tableau
Unlock your data analytics with tableau
 

Recently uploaded

Recently uploaded (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Low code love salesforce automation tool vs apex code

  • 1. Salesforce Admin Group, Trichy Low Code Love: Salesforce Automation Tool vs Apex Code
  • 2. Kadhar Basha J Salesforce Admin Group, Trichy Trailblazer Community Group Leader MST Solutions Sundaravel J Salesforce Admin Group, Trichy Trailblazer Community Group Co-Leader MST Solutions Salesforce Admin Group, Trichy
  • 3. Salesforce Admin Group, Trichy Speaker Kadhar Basha J MST Solutions
  • 4. Salesforce Admin Group, Trichy • Meetup Success • Public Interest • Social Media promotions • Leader contribution • Previous meetups • Achievement • Admin path
  • 5. Today’s Agenda • What is a Roll-Up summary Field? • What is the necessity of automation? • What all are the limitations of Roll-Up • What alternative solutions do we have? • Demo • Questions & Answers • Conclusion
  • 6. What is a Roll-Up summary Field?Logo • Roll-up summary is a built-in functionality in Salesforce. They allow you to create Sums, Counts, and more for objects that share a Master- Detail relationship. • Cannot use Roll-Up Summary fields to create a Sum or Count for objects related with a Lookup field • The Roll-up field automatically looks for the change in related records and automatically updates the Master record.
  • 7. Continued…Logo • This can be created only when the relationship between Parent and child is ‘Master-Detail’ Relation.
  • 8. ExampleLogo we have ‘Admin’ object, which his having a ‘Trichy’ as Child Object. We can calculate the number of child objects exists for the ‘Admin’ and display them in the ‘Admin’ object. When a new ‘Trichy’ is added, the roll-up summary field in ‘Admin’ is updated automatically.
  • 10. What is the necessity of automation?Logo There are two more options to create a roll-up field without MD relationship. • Apex code • Automation process Why we choose Automation over apex code? We can integrate different Automation tools like Process Builder and Auto launched Flow to perform a complex process and can even call Apex code from the tools. In short, they have made the jobs of Salesforce Administrators easier.
  • 11. Automation TypesLogo Automation process has divided into four different types based on the functionality • Workflow • Process Builder • Approval Process • Flow Builder
  • 12. What all are the limitations of Roll-Up summary fieldLogo • A Roll-up summary can be created only on records which are having Master-Detail Relationship. • A Master-detail relationship can’t be changed to lookup relationship after creating a roll-up summary field on an object. • When you refer to a roll-up summary field in a list view or report, you can’t use certain qualifiers, including: Starts with Contains, Does not contain, Includes, Excludes and Within.
  • 13. What alternative solutions do we have?Logo Now we can be able to create a Sum, Count, Min and Max field to populate values on objects that do not share a Master-Detail relationship using either Automation or Developing concepts • Apex/Trigger • Flow/Process Builder Screen Flow Auto-Launched Flow(Flow with Process Builder) Triggered Flow Lightning Scheduler Flow
  • 14. Apex TriggerLogo trigger ApexRollUpSummaryTrigger on Trichy__c (after insert, after update, after delete, after undelete) { if (trigger.isAfter && (trigger.isInsert || trigger.isUpdate || trigger.isUndelete)) { ApexRollUpSummary.sumofMembers(trigger.new); } else if (trigger.isAfter && trigger.isDelete) { ApexRollUpSummary.sumofMembers(trigger.old); } }
  • 15. Apex ClassLogo public class ApexRollUpSummary { public static void sumofMembers(list<Trichy__c> lstOfMembers) { Set<Id> adminIds = new Set<Id>(); List<Admin__c> updLstOfAdm = new List<Admin__c>(); List<Trichy__c> memberList = new List<Trichy__c>(); for(Trichy__c trichy : lstOfMembers) { if(trichy.Admin__c != null) adminIds.add(trichy.Admin__c); }
  • 16. ContinuationLogo List<Admin__c> lstAdm = [SELECT Id,Name,Total_Members__c, (SELECT Id,Group_Members__c FROM Trichys__r) FROM Admin__c WHERE Id IN : adminIds]; for(Admin__c adm : lstAdm) { decimal total = 0; if(adm.Trichys__r.size() >0) for(Trichy__c tcy : adm.Trichys__r) { if(tcy.Group_Members__c != null) total = total+tcy.Group_Members__c;
  • 21. Challenges in ApexLogo • Need to maintain all the insert and update events in a single trigger for a single object (As part of best practice) • Need to have handler logic in separate apex class. • Mandatorily should write apex test class and have test coverage of above 75% for and every class. • Test class should cover positive, negative and bulk scenarios (As part of best practice). • Need to have trigger switch in order to turn it off in production.
  • 24. Conclusion • Sometimes Apex code also depend on Automation process • New version of Flow contains all those options which is available after wrote a huge lines of code in Apex. • Initially process builder doesn’t have “Delete” option but that would be overcome by Flow builder • As a Low Code Lover, I would suggest to go with Automation