Hi Guys ,
We can create Visualforce Pages dynamically . Just need to write the script in Apex Class and avoiding on Visualforce Page.
Here I am just creating a list of string with the Account Object Fields with their API name and passing this on Visualforce page .
Controller : =======
We can create Visualforce Pages dynamically . Just need to write the script in Apex Class and avoiding on Visualforce Page.
Here I am just creating a list of string with the Account Object Fields with their API name and passing this on Visualforce page .
Controller : =======
public class DynamicPage{ public DynamicPage(ApexPages.StandardController controller) { } public Account acc {get;set;} public List<String> threeFieldList { get { if (threeFieldList == null) { threeFieldList = new List<String>(); threeFieldList.add('Industry'); threeFieldList.add('AnnualRevenue'); threeFieldList.add('BillingCity') } return threeFieldList; } private set; } }Page Code : =======
<apex:page standardController="Account" extensions="DynamicPage"> <apex:form > <apex:pageBlock title="Binding Input Field Dynamically" mode="edit"> <apex:pageBlockSection columns="1"> <apex:inputField value="{!Account.Name}" /> <apex:repeat value="{!threeFieldList}" var="afield" > <apex:inputField value="{!acc[afield]}" /> </apex:repeat> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>So when we need to add another field just need to add that field API Name in threeFieldList which passing in repeater.
Hello Vijay,
ReplyDeleteThanks for the sharing of code,
you can use SalesForce Schema to make it more independent and dynamic so by applying that you will not have to add anything in your code after changing the Object Structure. All the work will get done dynamically.
I have written my blog for the same purpose but as my blog is on initial level, so kindly have a look and give me your valuable feedbacks.
http://www.amitgoyal09.blogspot.com
Hi Amit ,
ReplyDeleteThanks for sharing your views but I dint understand can you please share the code so that I have better understanding .
Thanks in advance.
Salesforce Admin Online Training - 21st Century Software ...
ReplyDeletewww.21cssindia.com/courses/salesforce-admin-online-training-143.html
Salesforce admin online training by 21cssindia the largest institute in providing online trainings in all technologies. Salesforce admin training, salesforce ...
salesforce developer online training| salesforce developer ...
www.21cssindia.com/.../salesforce-developer-online-training-144.html
21cssindia provides Salesforce developer online training by real time Experts. Call us +91 9000444287 for online training and demo. Online Salesforce ...
salesforce crm online training| salesforce crm training| call ...
www.21cssindia.com/courses/salesforce-crm-online-training-212.html
21cssindia provides Salesforce crm online training by real time Experts. Call us +91 9000444287 for online training and demo. Online Salesforce crm training ...
Learn Salesforce.com developer courses online/classroom in Delhi from top training institutes and get Salesforcedeveloper certification. Get details on course fees @91-931OO96831!!
ReplyDelete
ReplyDeleteTop in salesforce Online Training Hyderabad@Capitalinfo solutions
slaesforce online training
slaesforce Integration training
slaesforce online training
capitalinfosolutionsindia
Thanks for sharing the awesome imformation. check Salesforce Training In Hyderabad
ReplyDeleteThanks for sharing valuable information and it is useful for onlineitguru provides the best salesforce Online course Hyderabad
ReplyDeleteThis is one awesome blog article. Much thanks again salesforce Online Course
ReplyDeleteinformative blog thanks for providing such a great information.
ReplyDeleteSalesforce Training in Hyderabad | Salesforce Admin Training in Hyderabad
Thank you for sharing such great information very useful to us.
ReplyDeleteSalesforce Training in Delhi