You need to sign in to do that
Don't have an account?
Rakshana Cube84
How to pull all fields from an object dynamically to visualforce page
Hi All,
I have a scenario as showing all fields from an object in a visualforce page dynamically. That is I want to pull all the fields and put it in <apex:inputfield> component for creating a record from that page.
But If I am creating a field in that particular object which should be added automatically without changing the code.
Thanks,
Rakshana
I have a scenario as showing all fields from an object in a visualforce page dynamically. That is I want to pull all the fields and put it in <apex:inputfield> component for creating a record from that page.
But If I am creating a field in that particular object which should be added automatically without changing the code.
Thanks,
Rakshana
You have to use generic Sobject methodology to show all the fields into a vf page show that it can maintain dynamic nature.
So I am going to share u code snippet. With this uwill get a idea how to implement your own, and please igonre designing of my page because I am very poor in it :(
VisualForce Code
Apex Controller
For the demo purpose I did this for Account object but you can change it as per your requirement.
All Answers
You have to use generic Sobject methodology to show all the fields into a vf page show that it can maintain dynamic nature.
So I am going to share u code snippet. With this uwill get a idea how to implement your own, and please igonre designing of my page because I am very poor in it :(
VisualForce Code
Apex Controller
For the demo purpose I did this for Account object but you can change it as per your requirement.
Please Let us know that your problem is solved or if your problem is solved by above answers then please mark that answer as a best answer.
Thanks
Saket Sharma
Thanks,
Rakshana