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

PDF
Lakhs crores indian comma separation in ABAP Flex Excel
DOCX
VB Programe in excel
PDF
Gokul bok
PPT
Sending data in cgi
PPTX
Angular Presentation
PPTX
SFDC UI - Advanced Visualforce
PPTX
Getting a Quick Start with Visualforce
PPTX
Hands-On Workshop: Introduction to Development on Force.com for Developers
Lakhs crores indian comma separation in ABAP Flex Excel
VB Programe in excel
Gokul bok
Sending data in cgi
Angular Presentation
SFDC UI - Advanced Visualforce
Getting a Quick Start with Visualforce
Hands-On Workshop: Introduction to Development on Force.com for Developers

Similar to Dynamic visualforce components in Salesforce (20)

PPTX
Dynamic Forms: Overview & Deep Dive Tutorial
PDF
Making Your Apex and Visualforce Reusable
PDF
Demo how to create visualforce and apex controller to update, delete custom o...
PDF
Dynamic Apex Binding
PDF
Introduction to Visualforce
PDF
Demo how to create visualforce page and custom controller via developer console
PPTX
SFDC UI - Introduction to Visualforce
PDF
Con5623 pdf 5623_001
PDF
Write Generic Code with the Tooling API
PPTX
Building Robust Applications with Dynamic Visualforce
PPTX
Salesforce Application Development
PDF
Programming Building Blocks for Admins
PDF
Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript ...
PDF
Elevate london dec 2014.pptx
PPTX
Introduction to visualforce
PDF
Apex code-fundamentals
PDF
Apex code-fundamentals
PPTX
Sales force
PPTX
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
PPTX
#CNX14 - Intro to Force
Dynamic Forms: Overview & Deep Dive Tutorial
Making Your Apex and Visualforce Reusable
Demo how to create visualforce and apex controller to update, delete custom o...
Dynamic Apex Binding
Introduction to Visualforce
Demo how to create visualforce page and custom controller via developer console
SFDC UI - Introduction to Visualforce
Con5623 pdf 5623_001
Write Generic Code with the Tooling API
Building Robust Applications with Dynamic Visualforce
Salesforce Application Development
Programming Building Blocks for Admins
Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript ...
Elevate london dec 2014.pptx
Introduction to visualforce
Apex code-fundamentals
Apex code-fundamentals
Sales force
Hands-On Workshop: Introduction to Coding for on Force.com for Admins and Non...
#CNX14 - Intro to Force
Ad

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
A Presentation on Artificial Intelligence
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
Building Integrated photovoltaic BIPV_UPV.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
A Presentation on Artificial Intelligence
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Ad

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