SlideShare a Scribd company logo
Taking Apex and Visualforce Above 
and Beyond 
Jay Jayakumaran 
Yahoo! Inc. 
Senior Developer
Jay Jayakumaran 
Senior Developer
Agenda 
– Building synchronous data loader using Apex and Visualforce 
– Bulk edit using Apex and Visualforce 
– Grand Children Design Pattern 
– Building custom field track history using Apex and Visualforce
Building Synchronous data loader 
using Apex and Visualforce
Building synchronous data loader using Apex and 
Visualforce 
• Why? 
– Give Standard Users insert, update, and deletion rights without extending them Admin rights 
such as API 
or Modify All Data. 
– Existing desktop based tools require user training or users to rely on the admin for all data 
loads. 
– The functionality is not available out of the box 
https://success.salesforce.com/ideaview?id=08730000000Bre6AAC 
• What has Yahoo! done? 
–We have customized Data import tools to bulk insert/update 10,000 records in real time 
synchronously.
Highlights of the Visualforce data loader 
 Step by step wizard process for Data import 
 A Standard help template for the sObject to load the data 
 UI Preview of the csv to be imported/updated 
 Customized data import logic which parses a generic csv file and inserts Parent, Children, and 
Grandchildren in one single transaction 
 Advanced success and error records display with RollBack or finish options 
 Sending success and error records as csv files to email 
 Code can be reused if necessary by other teams with minimal changes
Visualforce data loader – Screen shots 
STEP 1: Choose file 
STEP 2: 
Preview file 
STEP 3: View Success 
and Error records with 
Rollback/Finish
Inserting Parent, Children, and Grand Children in one single 
transaction 
Data Import tool 
(VF Page & Apex class) 
Template sObject 
csv 
Parent sObject 
Create Success 
and error files; and 
send email 
Child sObject Grand Children sObject
Update/Delete Operation 
sObject 
csv 
Data Import tool (Identifies records using 
record name) 
Create Success and error files; and 
send email
Code walkthrough 
 Convert csv blob to String 
 Use DescribeFieldResult to get the API names of the field labels 
 Parse the String to form a collection of sObjects 
 Use Database methods to do insert or update so that we can handle success and 
error records
Demo - Building Synchronous data 
loader using Apex and Visualforce
Bulk Edit using Apex and 
Visualforce
Bulk Edit using Apex and Visualforce 
 Why ? 
 Out of the Box list views in salesforce provides bulk edit in UI 
 Users have to create first list view of their choice or clone list views 
 User training required on how to customize list views and filter 
 Highlights 
 Visualforce page for bulk edit 
 Real time filters and display of records meeting the criteria 
 Has all the features of the standard bulk edit 
 Error handling (Triggers and validation rules)
Demo - Bulk Edit using Apex and Visualforce
Grandchildren UI pattern
Grandchildren Pattern (User Navigation) 
– In Standard SFDC, drilling down on the Grand Children records from the parent record requires 3 pages. 
– Accommodate the CRUD of children and Grand Children records in just one page 
– Used generally in the Parent record Detail/View page 
– Achieved through Radio Button related lists or Expand Collapse pattern 
– DEMO 
Parent 
Child 
Grand Child
Custom Field Track History
Field Track History using Apex and Visualforce 
Salesforce.com Field Track History limitations 
 Can track only 20 fields per sObject (need to contact SFDC support to increase) 
 Cannot record the value changes on MultiSelect Picklist and long text area fields 
 Cannot do data migration on Standard History tables 
 (We have to create custom history tables; data migrate legacy audit trail into custom 
history tables; Combine both the standard history data and custom history data into one 
List on UI).
Field Track History using Apex and Visualforce – Cont. 
 Create after insert, after update triggers on sObject 
 Track the value changes using Trigger.old and Trigger.New 
 Insert the history records into custom history tables 
Sample code: 
// Save ContentLicense History for Multi-select picklist fields 
//writing such code for every field on each sObject is not efficient and is repetitive consuming code lines 
if(Trigger.isUpdate) { 
List<ContentLicenseLegacyHistory__c> rhInsList = new List<ContentLicenseLegacyHistory__c> (); 
for (ContentLicense__c rOld : Trigger.old) { 
ContentLicense__c rNew = Trigger.newMap.get(rOld.Id) 
if (rOld.Device__c != rNew.Device__c) { 
rhinsList.add(new ContentLicenseLegacyHistory__c(parentid__c = rOld.id,field__c = 'Device__c',oldValue__c = rOld.Device__c, newValue__c = 
rNew.Device__c, CreatedDate__c = rNew.LastModifiedDate, CreatedById__c = rNew.CreatedById)); 
} 
if (rOld.UserGeo__c != rNew.UserGeo__c) { 
rhinsList.add(new ContentLicenseLegacyHistory__c(parentid__c = rOld.id,field__c = 'UserGeo__c',oldValue__c = rOld.UserGeo__c, newValue__c 
= rNew.UserGeo__c, CreatedDate__c = rNew.LastModifiedDate, CreatedById__c = rNew.CreatedById)); 
} 
insert rhInsList;
Custom Field Track history - architecture 
App. User Interface: (Visualforce, JavaScript, CSS, Apex class, and Config Tables) 
Trigger and Generic Apex class framework: (Apex Trigger, Apex class, and Custom History tables) 
Generic History UI Component ( Visualforce, Apex class) 
Config Tables to 
store the sObject 
names and its fields 
to be tracked 
GUI config for sObject and 
fields to be tracked 
Apex Trigger 
framework (after 
insert, update) 
Generic Apex class Framework 
createHistory(sObjectName, 
FieldName, OldObjectCopy, 
newObjectCopy) 
History 
records 
Insert field track history 
records with field old and 
new values into custom 
history tables 
Generic UI Component 
Loads the history records 
into standard pagelayouts 
or sObject Visualforce 
Pages
Q&A
Taking Apex and Visualforce Above and Beyond

More Related Content

What's hot

11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
Vivek chan
 
jQuery and AJAX with Rails
jQuery and AJAX with RailsjQuery and AJAX with Rails
jQuery and AJAX with Rails
Alan Hecht
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
Bhumivaghasiya
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
Phil Wicklund
 
05.SharePointCSOM
05.SharePointCSOM05.SharePointCSOM
05.SharePointCSOM
EaswariSP
 
Adf performance tuning tips slideshare
Adf performance tuning tips slideshareAdf performance tuning tips slideshare
Adf performance tuning tips slideshare
Vinay Kumar
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
Rob Windsor
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
George Estebe
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
tutorialsruby
 
SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!
Sébastien Levert
 
Introduction to App Engine Development
Introduction to App Engine DevelopmentIntroduction to App Engine Development
Introduction to App Engine Development
Ron Reiter
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
SharePoint Saturday NY
 
Designing well known websites with ADF Rich Faces
Designing well known websites with ADF Rich FacesDesigning well known websites with ADF Rich Faces
Designing well known websites with ADF Rich Faces
maikorocha
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
BIWUG
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
shravan kumar chelika
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
Appear
 
BDD in practice based on an open source project
BDD in practice based on an open source projectBDD in practice based on an open source project
BDD in practice based on an open source project
Łukasz Chruściel
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
Ankit Gupta
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
Rob Windsor
 

What's hot (19)

11 asp.net session16
11 asp.net session1611 asp.net session16
11 asp.net session16
 
jQuery and AJAX with Rails
jQuery and AJAX with RailsjQuery and AJAX with Rails
jQuery and AJAX with Rails
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
 
05.SharePointCSOM
05.SharePointCSOM05.SharePointCSOM
05.SharePointCSOM
 
Adf performance tuning tips slideshare
Adf performance tuning tips slideshareAdf performance tuning tips slideshare
Adf performance tuning tips slideshare
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
 
SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!SharePoint Conference 2018 - APIs, APIs everywhere!
SharePoint Conference 2018 - APIs, APIs everywhere!
 
Introduction to App Engine Development
Introduction to App Engine DevelopmentIntroduction to App Engine Development
Introduction to App Engine Development
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
Designing well known websites with ADF Rich Faces
Designing well known websites with ADF Rich FacesDesigning well known websites with ADF Rich Faces
Designing well known websites with ADF Rich Faces
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
 
How to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR RestHow to convert custom plsql to web services-Soap OR Rest
How to convert custom plsql to web services-Soap OR Rest
 
How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...How to build integrated, professional enterprise-grade cross-platform mobile ...
How to build integrated, professional enterprise-grade cross-platform mobile ...
 
BDD in practice based on an open source project
BDD in practice based on an open source projectBDD in practice based on an open source project
BDD in practice based on an open source project
 
Asp PPT (.NET )
Asp PPT (.NET )Asp PPT (.NET )
Asp PPT (.NET )
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 

Similar to Taking Apex and Visualforce Above and Beyond

takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01
takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01
takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01
Sadeesh Jayakumaran ☁
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan
 
Salesforce Summer 14 Release
Salesforce Summer 14 ReleaseSalesforce Summer 14 Release
Salesforce Summer 14 Release
Jyothylakshmy P.U
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
Amin Uddin
 
Summer '16 Realease notes
Summer '16 Realease notesSummer '16 Realease notes
Summer '16 Realease notes
aggopal1011
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
Shelli Ciaschini
 
SharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsSharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and Events
Mohan Arumugam
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
Julie Iskander
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
Ali Taki
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
parallelminder
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
Vivek chan
 
Skills Portfolio
Skills PortfolioSkills Portfolio
Skills Portfolio
rolee23
 
Migrating to SharePoint 2013 - Business and Technical Perspective
Migrating to SharePoint 2013 - Business and Technical PerspectiveMigrating to SharePoint 2013 - Business and Technical Perspective
Migrating to SharePoint 2013 - Business and Technical Perspective
John Calvert
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
goodfriday
 
SetFocus Portfolio
SetFocus PortfolioSetFocus Portfolio
SetFocus Portfolio
Frank Stepanski
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL Advanced
LeanIX GmbH
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
Stamatis Zampetakis
 
Demo Guidebook 040110
Demo Guidebook 040110Demo Guidebook 040110
Demo Guidebook 040110
Brad Ganas
 
Introduction to apex
Introduction to apexIntroduction to apex
Introduction to apex
Rinku Saini
 
Serverless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData SeattleServerless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData Seattle
Jim Dowling
 

Similar to Taking Apex and Visualforce Above and Beyond (20)

takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01
takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01
takingapexandvisualforceaboveandbeyondv1-141120224449-conversion-gate01
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
Salesforce Summer 14 Release
Salesforce Summer 14 ReleaseSalesforce Summer 14 Release
Salesforce Summer 14 Release
 
Advance Sql Server Store procedure Presentation
Advance Sql Server Store procedure PresentationAdvance Sql Server Store procedure Presentation
Advance Sql Server Store procedure Presentation
 
Summer '16 Realease notes
Summer '16 Realease notesSummer '16 Realease notes
Summer '16 Realease notes
 
Sql Portfolio
Sql PortfolioSql Portfolio
Sql Portfolio
 
SharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and EventsSharePoint Object Model, Web Services and Events
SharePoint Object Model, Web Services and Events
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
Asp Net Advance Topics
Asp Net Advance TopicsAsp Net Advance Topics
Asp Net Advance Topics
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
Skills Portfolio
Skills PortfolioSkills Portfolio
Skills Portfolio
 
Migrating to SharePoint 2013 - Business and Technical Perspective
Migrating to SharePoint 2013 - Business and Technical PerspectiveMigrating to SharePoint 2013 - Business and Technical Perspective
Migrating to SharePoint 2013 - Business and Technical Perspective
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
 
SetFocus Portfolio
SetFocus PortfolioSetFocus Portfolio
SetFocus Portfolio
 
GraphQL Advanced
GraphQL AdvancedGraphQL Advanced
GraphQL Advanced
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
Demo Guidebook 040110
Demo Guidebook 040110Demo Guidebook 040110
Demo Guidebook 040110
 
Introduction to apex
Introduction to apexIntroduction to apex
Introduction to apex
 
Serverless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData SeattleServerless ML Workshop with Hopsworks at PyData Seattle
Serverless ML Workshop with Hopsworks at PyData Seattle
 

More from Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Salesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
Salesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
Salesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
Salesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
Salesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
Salesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
Salesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
Salesforce Developers
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
Salesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
Salesforce Developers
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
Salesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
Salesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
Salesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
Salesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
Salesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
Salesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
Salesforce Developers
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
Salesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
Salesforce Developers
 

More from Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 

Recently uploaded

Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 

Recently uploaded (20)

Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 

Taking Apex and Visualforce Above and Beyond

  • 1. Taking Apex and Visualforce Above and Beyond Jay Jayakumaran Yahoo! Inc. Senior Developer
  • 3. Agenda – Building synchronous data loader using Apex and Visualforce – Bulk edit using Apex and Visualforce – Grand Children Design Pattern – Building custom field track history using Apex and Visualforce
  • 4. Building Synchronous data loader using Apex and Visualforce
  • 5. Building synchronous data loader using Apex and Visualforce • Why? – Give Standard Users insert, update, and deletion rights without extending them Admin rights such as API or Modify All Data. – Existing desktop based tools require user training or users to rely on the admin for all data loads. – The functionality is not available out of the box https://success.salesforce.com/ideaview?id=08730000000Bre6AAC • What has Yahoo! done? –We have customized Data import tools to bulk insert/update 10,000 records in real time synchronously.
  • 6. Highlights of the Visualforce data loader  Step by step wizard process for Data import  A Standard help template for the sObject to load the data  UI Preview of the csv to be imported/updated  Customized data import logic which parses a generic csv file and inserts Parent, Children, and Grandchildren in one single transaction  Advanced success and error records display with RollBack or finish options  Sending success and error records as csv files to email  Code can be reused if necessary by other teams with minimal changes
  • 7. Visualforce data loader – Screen shots STEP 1: Choose file STEP 2: Preview file STEP 3: View Success and Error records with Rollback/Finish
  • 8. Inserting Parent, Children, and Grand Children in one single transaction Data Import tool (VF Page & Apex class) Template sObject csv Parent sObject Create Success and error files; and send email Child sObject Grand Children sObject
  • 9. Update/Delete Operation sObject csv Data Import tool (Identifies records using record name) Create Success and error files; and send email
  • 10. Code walkthrough  Convert csv blob to String  Use DescribeFieldResult to get the API names of the field labels  Parse the String to form a collection of sObjects  Use Database methods to do insert or update so that we can handle success and error records
  • 11. Demo - Building Synchronous data loader using Apex and Visualforce
  • 12. Bulk Edit using Apex and Visualforce
  • 13. Bulk Edit using Apex and Visualforce  Why ?  Out of the Box list views in salesforce provides bulk edit in UI  Users have to create first list view of their choice or clone list views  User training required on how to customize list views and filter  Highlights  Visualforce page for bulk edit  Real time filters and display of records meeting the criteria  Has all the features of the standard bulk edit  Error handling (Triggers and validation rules)
  • 14. Demo - Bulk Edit using Apex and Visualforce
  • 16. Grandchildren Pattern (User Navigation) – In Standard SFDC, drilling down on the Grand Children records from the parent record requires 3 pages. – Accommodate the CRUD of children and Grand Children records in just one page – Used generally in the Parent record Detail/View page – Achieved through Radio Button related lists or Expand Collapse pattern – DEMO Parent Child Grand Child
  • 18. Field Track History using Apex and Visualforce Salesforce.com Field Track History limitations  Can track only 20 fields per sObject (need to contact SFDC support to increase)  Cannot record the value changes on MultiSelect Picklist and long text area fields  Cannot do data migration on Standard History tables  (We have to create custom history tables; data migrate legacy audit trail into custom history tables; Combine both the standard history data and custom history data into one List on UI).
  • 19. Field Track History using Apex and Visualforce – Cont.  Create after insert, after update triggers on sObject  Track the value changes using Trigger.old and Trigger.New  Insert the history records into custom history tables Sample code: // Save ContentLicense History for Multi-select picklist fields //writing such code for every field on each sObject is not efficient and is repetitive consuming code lines if(Trigger.isUpdate) { List<ContentLicenseLegacyHistory__c> rhInsList = new List<ContentLicenseLegacyHistory__c> (); for (ContentLicense__c rOld : Trigger.old) { ContentLicense__c rNew = Trigger.newMap.get(rOld.Id) if (rOld.Device__c != rNew.Device__c) { rhinsList.add(new ContentLicenseLegacyHistory__c(parentid__c = rOld.id,field__c = 'Device__c',oldValue__c = rOld.Device__c, newValue__c = rNew.Device__c, CreatedDate__c = rNew.LastModifiedDate, CreatedById__c = rNew.CreatedById)); } if (rOld.UserGeo__c != rNew.UserGeo__c) { rhinsList.add(new ContentLicenseLegacyHistory__c(parentid__c = rOld.id,field__c = 'UserGeo__c',oldValue__c = rOld.UserGeo__c, newValue__c = rNew.UserGeo__c, CreatedDate__c = rNew.LastModifiedDate, CreatedById__c = rNew.CreatedById)); } insert rhInsList;
  • 20. Custom Field Track history - architecture App. User Interface: (Visualforce, JavaScript, CSS, Apex class, and Config Tables) Trigger and Generic Apex class framework: (Apex Trigger, Apex class, and Custom History tables) Generic History UI Component ( Visualforce, Apex class) Config Tables to store the sObject names and its fields to be tracked GUI config for sObject and fields to be tracked Apex Trigger framework (after insert, update) Generic Apex class Framework createHistory(sObjectName, FieldName, OldObjectCopy, newObjectCopy) History records Insert field track history records with field old and new values into custom history tables Generic UI Component Loads the history records into standard pagelayouts or sObject Visualforce Pages
  • 21. Q&A

Editor's Notes

  1. Intro (keep to under a minute)
  2. Step by step wizard process for Data import Step 1: A Standard help template for the sObject to load the data The Column headers in csv should be same as the UI/Label name of the field UI Preview of the csv to be imported/updated Step 2: UI Preview of the csv to be imported/updated Customized data import logic which parses a template csv file and inserts Parent, children, and grandchildren in one single transaction Can be extended for other database operation such as Update, Upsert, and delete Step 3: All the standard validation rules and trigger error handling applies Any other custom error handling can be coded as needed Advanced success and error records display with RollBack or finish options Sending success and error records as csv files to email Code can be reused if necessary by other teams with minimal changes Note: Update operation can be done using record names instead of record Ids. (Name should be unique on the sObject to be updated/deleted) Lookup/Parent records ids can be looked up using their record names
  3. When talking to this slide detail the components in use such as “The Template sObject csv file is sent to the Data Import tool comprising of a VF page with Apex Class Controller which re-directs a preview VF page showing a preview of the data structure (columns, fields, records to be inserted) that you will then insert as the Parent Custom object first follow by the Child and Grand Child records and finally showing your success and error VF page giving options to Finish and return to the start of the import tool wizard (VF Page) or rollback the insert your just did.”
  4. Recap of the Presentation after these slides refer to the Overview notes on the demo slide!
  5. Step by step wizard process for Data import Step 1: A Standard help template for the sObject to load the data The Column headers in csv should be same as the UI/Label name of the field UI Preview of the csv to be imported/updated Step 2: UI Preview of the csv to be imported/updated Customized data import logic which parses a template csv file and inserts Parent, children, and grandchildren in one single transaction Can be extended for other database operation such as Update, Upsert, and delete Step 3: All the standard validation rules and trigger error handling applies Any other custom error handling can be coded as needed Advanced success and error records display with RollBack or finish options Sending success and error records as csv files to email Code can be reused if necessary by other teams with minimal changes Note: Update operation can be done using record names instead of record Ids. (Name should be unique on the sObject to be updated/deleted) Lookup/Parent records ids can be looked up using their record names
  6. Step by step wizard process for Data import Step 1: A Standard help template for the sObject to load the data The Column headers in csv should be same as the UI/Label name of the field UI Preview of the csv to be imported/updated Step 2: UI Preview of the csv to be imported/updated Customized data import logic which parses a template csv file and inserts Parent, children, and grandchildren in one single transaction Can be extended for other database operation such as Update, Upsert, and delete Step 3: All the standard validation rules and trigger error handling applies Any other custom error handling can be coded as needed Advanced success and error records display with RollBack or finish options Sending success and error records as csv files to email Code can be reused if necessary by other teams with minimal changes Note: Update operation can be done using record names instead of record Ids. (Name should be unique on the sObject to be updated/deleted) Lookup/Parent records ids can be looked up using their record names
  7. Step by step wizard process for Data import Step 1: A Standard help template for the sObject to load the data The Column headers in csv should be same as the UI/Label name of the field UI Preview of the csv to be imported/updated Step 2: UI Preview of the csv to be imported/updated Customized data import logic which parses a template csv file and inserts Parent, children, and grandchildren in one single transaction Can be extended for other database operation such as Update, Upsert, and delete Step 3: All the standard validation rules and trigger error handling applies Any other custom error handling can be coded as needed Advanced success and error records display with RollBack or finish options Sending success and error records as csv files to email Code can be reused if necessary by other teams with minimal changes Note: Update operation can be done using record names instead of record Ids. (Name should be unique on the sObject to be updated/deleted) Lookup/Parent records ids can be looked up using their record names
  8. Step by step wizard process for Data import Step 1: A Standard help template for the sObject to load the data The Column headers in csv should be same as the UI/Label name of the field UI Preview of the csv to be imported/updated Step 2: UI Preview of the csv to be imported/updated Customized data import logic which parses a template csv file and inserts Parent, children, and grandchildren in one single transaction Can be extended for other database operation such as Update, Upsert, and delete Step 3: All the standard validation rules and trigger error handling applies Any other custom error handling can be coded as needed Advanced success and error records display with RollBack or finish options Sending success and error records as csv files to email Code can be reused if necessary by other teams with minimal changes Note: Update operation can be done using record names instead of record Ids. (Name should be unique on the sObject to be updated/deleted) Lookup/Parent records ids can be looked up using their record names