SlideShare a Scribd company logo
Quote of the day
 “Tell me and I forget. Teach me and I
remember. Involve me and I learn.”
 by Benjamin Franklin
Dynamic VF Components
in
Designed in Apex class
Introduction :
What is Dynamic Programming :
• Method for solving a complex problem by breaking it down into a
collection of simpler sub problems, and solve all once, storing their
solutions for future reference to avoid re-computing again for same
problem. So we can save computation time, memory.
Application of
Dynamic
Concept in
Salesfore
Few more Dynamic concepts in Salesforce:
 Dynamic Approval Process
 Dynamic Reporting
 Dynamic VF Components
Representation On VF Page
<apex:dynamicComponent componentValue=”{!dynamicDetails}”/>
 This tag acts as a placeholder for your dynamic component.
 componentValue attribute is must which accepts the name of an Apex method that returns a
dynamic component.
Representation On Apex Class
Creating a Visualforce Component in Apex can be done by referencing the Component.Apex
namespace along with name of the component.
Ex : Component.Apex.PageBlock.
Component.Apex.OutputText.
Component.Apex.OutputField outTxt = new Component.Apex.OutputField();
outTxt.value = rec.Name;
For Reference :
VF Component Reference from any vf page
Dynamic Visualforce Notation :
 Component.Apex.PageBlock.
Dynamic Component Properties
 childComponents : By using this we can add one component to other.
Ex: pageBlock contains pageBlockSection
Component.Apex.PageBlock pageBlk = new Component.Apex.PageBlock();
Component.Apex.PageBlockSection pgBlkSec = new
Component.Apex.PageBlockSection(title='header');
pageBlk.childComponents.add(pgBlkSec);
 Expressions : To bind properties to component
Ex : Component.Apex.InputField inpFld = new Component.Apex.InputField();
inpField.expressions.value = '{!Account.Name}';
inpField.expressions.id = '{!$User.FirstName}';
Usage with Examples
 Example 1 :
Display Opportunities in different tables according to their stage value.
Note : Number of Stage picklist values vary from Sandbox to
production.
 Example 2 :
Customer name, Email Id, Mobile Number, Contact me(check box), Time to
Contact(Picklist) display fields dynamically on selection of Picklist A, Picklist B
values while creating Opportunity record.
Note :
Display all fields for a1,b1. (Nothing must)
Contact Name, Email are must for a1,b2.
Contact Name, Mobile, Contact Me are must for a2,b1.
Display all and all are must for a2,b2.
Limitations :
 No Dynamic Apex Representation for below components :
 <apex: attribute>
 <apex: component>
 <apex: componentBody>
 <apex: composition>
 <apex: define>
 <apex: dynamicComponent>
 <apex: include>
 <apex: insert>
 <apex: param>
 <apex: variable>
Resources
 https://developer.salesforce.com/page/Dynamic_Visualforce_Components
 https://yourInstance/apexpages/apexcomponents.apexp
 https://harikrishnaratikindi.wordpress.com/2016/06/18/use-of-dynamic-
components-in-salesforce/
 https://developer.salesforce.com/docs/atlas.en-
us.pages.meta/pages/pages_compref_dynamicComponent.htm
 https://developer.salesforce.com/docs/atlas.en-
us.pages.meta/pages/pages_dynamic_vf_components_implementation.htm
About Me :
 Salesforce dynamic concept expert
 Blog writer
 You can follow me in :
 Twitter : @harveensj5_hari
 Linkedin : https://in.linkedin.com/in/hari-krishna-2986bb106
 Blog : https://harikrishnaratikindi.wordpress.com/
 Github link : https://github.com/harveensj5/dynamicSalesforce
Thank you

More Related Content

Similar to Dynamic visualforce components in Salesforce

Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
Andi Simanjuntak
 
R Tanenbaum .Net Portfolio
R Tanenbaum .Net PortfolioR Tanenbaum .Net Portfolio
R Tanenbaum .Net Portfolio
Robert Tanenbaum
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
AustinaGRPaigey
 
Ways to Set Focus on an Input Field After Rendering in React.pptx
Ways to Set Focus on an Input Field After Rendering in React.pptxWays to Set Focus on an Input Field After Rendering in React.pptx
Ways to Set Focus on an Input Field After Rendering in React.pptx
BOSC Tech Labs
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Develop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdfDevelop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdf
flashfashioncasualwe
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercises
ddrschiw
 
Django wrapper
Django wrapperDjango wrapper
Django wrapper
sudipta nandi
 
exa_cer_g23
exa_cer_g23exa_cer_g23
exa_cer_g23
Agustin Zazueta
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
desaipratu10
 
27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...
Panorama Software
 
Javascript
JavascriptJavascript
Javascript
orestJump
 
React outbox
React outboxReact outbox
React outbox
Angela Lehru
 
Learning .NET Attributes
Learning .NET AttributesLearning .NET Attributes
Learning .NET Attributes
Pooja Gaikwad
 
Learn dot net attributes
Learn dot net attributesLearn dot net attributes
Learn dot net attributes
sonia merchant
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developers
Yakov Fain
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Tech OneStop
 
While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...
bhargavi804095
 
11-Classes.ppt
11-Classes.ppt11-Classes.ppt
11-Classes.ppt
basavaraj852759
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
jlshare
 

Similar to Dynamic visualforce components in Salesforce (20)

Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
R Tanenbaum .Net Portfolio
R Tanenbaum .Net PortfolioR Tanenbaum .Net Portfolio
R Tanenbaum .Net Portfolio
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
 
Ways to Set Focus on an Input Field After Rendering in React.pptx
Ways to Set Focus on an Input Field After Rendering in React.pptxWays to Set Focus on an Input Field After Rendering in React.pptx
Ways to Set Focus on an Input Field After Rendering in React.pptx
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Develop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdfDevelop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdf
 
XPages Workshop: Concepts And Exercises
XPages Workshop:   Concepts And ExercisesXPages Workshop:   Concepts And Exercises
XPages Workshop: Concepts And Exercises
 
Django wrapper
Django wrapperDjango wrapper
Django wrapper
 
exa_cer_g23
exa_cer_g23exa_cer_g23
exa_cer_g23
 
Web technology practical list
Web technology practical listWeb technology practical list
Web technology practical list
 
27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...27 - Panorama Necto 14 component mode & java script - visualization & data di...
27 - Panorama Necto 14 component mode & java script - visualization & data di...
 
Javascript
JavascriptJavascript
Javascript
 
React outbox
React outboxReact outbox
React outbox
 
Learning .NET Attributes
Learning .NET AttributesLearning .NET Attributes
Learning .NET Attributes
 
Learn dot net attributes
Learn dot net attributesLearn dot net attributes
Learn dot net attributes
 
Angular2 Development for Java developers
Angular2 Development for Java developersAngular2 Development for Java developers
Angular2 Development for Java developers
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
 
While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...While writing program in any language, you need to use various variables to s...
While writing program in any language, you need to use various variables to s...
 
11-Classes.ppt
11-Classes.ppt11-Classes.ppt
11-Classes.ppt
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
 

Recently uploaded

UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
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
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
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
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
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
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
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
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 

Recently uploaded (20)

UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
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
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
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
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
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
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
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
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 

Dynamic visualforce components in Salesforce

  • 1. Quote of the day  “Tell me and I forget. Teach me and I remember. Involve me and I learn.”  by Benjamin Franklin
  • 3. Introduction : What is Dynamic Programming : • Method for solving a complex problem by breaking it down into a collection of simpler sub problems, and solve all once, storing their solutions for future reference to avoid re-computing again for same problem. So we can save computation time, memory.
  • 5. Few more Dynamic concepts in Salesforce:  Dynamic Approval Process  Dynamic Reporting  Dynamic VF Components
  • 6. Representation On VF Page <apex:dynamicComponent componentValue=”{!dynamicDetails}”/>  This tag acts as a placeholder for your dynamic component.  componentValue attribute is must which accepts the name of an Apex method that returns a dynamic component.
  • 7. Representation On Apex Class Creating a Visualforce Component in Apex can be done by referencing the Component.Apex namespace along with name of the component. Ex : Component.Apex.PageBlock. Component.Apex.OutputText. Component.Apex.OutputField outTxt = new Component.Apex.OutputField(); outTxt.value = rec.Name; For Reference : VF Component Reference from any vf page Dynamic Visualforce Notation :  Component.Apex.PageBlock.
  • 8. Dynamic Component Properties  childComponents : By using this we can add one component to other. Ex: pageBlock contains pageBlockSection Component.Apex.PageBlock pageBlk = new Component.Apex.PageBlock(); Component.Apex.PageBlockSection pgBlkSec = new Component.Apex.PageBlockSection(title='header'); pageBlk.childComponents.add(pgBlkSec);  Expressions : To bind properties to component Ex : Component.Apex.InputField inpFld = new Component.Apex.InputField(); inpField.expressions.value = '{!Account.Name}'; inpField.expressions.id = '{!$User.FirstName}';
  • 9. Usage with Examples  Example 1 : Display Opportunities in different tables according to their stage value. Note : Number of Stage picklist values vary from Sandbox to production.  Example 2 : Customer name, Email Id, Mobile Number, Contact me(check box), Time to Contact(Picklist) display fields dynamically on selection of Picklist A, Picklist B values while creating Opportunity record. Note : Display all fields for a1,b1. (Nothing must) Contact Name, Email are must for a1,b2. Contact Name, Mobile, Contact Me are must for a2,b1. Display all and all are must for a2,b2.
  • 10. Limitations :  No Dynamic Apex Representation for below components :  <apex: attribute>  <apex: component>  <apex: componentBody>  <apex: composition>  <apex: define>  <apex: dynamicComponent>  <apex: include>  <apex: insert>  <apex: param>  <apex: variable>
  • 11. Resources  https://developer.salesforce.com/page/Dynamic_Visualforce_Components  https://yourInstance/apexpages/apexcomponents.apexp  https://harikrishnaratikindi.wordpress.com/2016/06/18/use-of-dynamic- components-in-salesforce/  https://developer.salesforce.com/docs/atlas.en- us.pages.meta/pages/pages_compref_dynamicComponent.htm  https://developer.salesforce.com/docs/atlas.en- us.pages.meta/pages/pages_dynamic_vf_components_implementation.htm
  • 12. About Me :  Salesforce dynamic concept expert  Blog writer  You can follow me in :  Twitter : @harveensj5_hari  Linkedin : https://in.linkedin.com/in/hari-krishna-2986bb106  Blog : https://harikrishnaratikindi.wordpress.com/  Github link : https://github.com/harveensj5/dynamicSalesforce