You need to sign in to do that
Don't have an account?
anjin reddy 9
Getting all fields&Labels of objects in one table
Hi Friends
Could you please suggest me that
How to get the all fields name and field label names of objects in One table
Could you please suggest me that
How to get the all fields name and field label names of objects in One table
In order to display filed data type along with label and names, you have to modify your VF page as well as controller class.
Please find below the update VF page and class :
VF Page : Controller class : Replace your code with above code.
Let me know if you have any further issues.
Regards,
Abhishek
All Answers
I have provided below a sample code to get all fields and labels of Account Object :
In the same way you can get all fields and labels of other objects also.
Let me know if you need more help on this.
Regards,
Abhishek Bansal.
Thanks
Amit Chaudhary
Tanks for suggest
I need to display all field names and label in one table ..Could please suggest me
please try to give to display both fields and labels of any object in one table
In order to show the names and labels in a single table you have to create a VF page and its Controller class.
I am providing you the code below for displaying fields related to Account.
Create a new class "TestingController" and add below mentioned Code in it :
Now create a new VF page and add below mentioned code in it. :
Now save the class and VF page.
When you click on preview button on VF page thn you will see a table with all fields and lables of account in one table.
Please see below screenshot :
Please modify your code if you want to show fileds for any other object.
Let me know if you need more help on this.
Regards,
Abhishek.
Thanks You so much
I got the Answer What Am expecting
As well as I need some more information that i need data types along with fields name
Can you please suggest me .Am waitmg for your answer
Thanks
In order to display filed data type along with label and names, you have to modify your VF page as well as controller class.
Please find below the update VF page and class :
VF Page : Controller class : Replace your code with above code.
Let me know if you have any further issues.
Regards,
Abhishek
Thank You so much ,,The Code which you send is very useful for us .
1) Issue is that ..starting letter of API Name is "CapitalLetter"..Its Genarating As "SmallLetter"
2)Is it Possible to generate the which its displyed in Org.
Plz Correct and resend me please
Thanks
This is the default behavior, and no there's no "direct" workaround.
Please find the reason for same below :
The reason why is because the Map returned by the call is actually a special map that I'll call CaseInsensitiveKeyMap. A normal map would more appropriately be called a CaseSensitiveKeyMap, because "Hello" and "hello" are two unique keys (because they use hashCode(), which will definitely return unique values for even a change in string case).
On the other hand, the describe calls, such as fields.getMap() and fieldSets.getMap(), effectively call String.toLowerCase() on each key before calling hashCode(), such that you can ask for Name, NAME, or name (or any other permutation) to get the correct field. Field names are case insensitive in Apex Code, and this map mimics that behavior.
If you absolutely wanted to have a case sensitive map, you'd have to construct your own Map, iterate through the values from the describe call, and set each key individually. This would be a large waste of CPU time for no real benefit, since there shouldn't be any specific reason why you need to have the correct casing.
Regards,
Abhishek
Thanks you so much for your suggest.My Solved
Thanks
Anjin
I just need fields , label and datatype of particulor object But not its child fields ,
2)The code which you send is extra fields .
so pleases once check and let me know plz
Thanks
Code Which you drop is genearting extra fileds can u plz check and let me know plzzzz
Thank you for giving valuble code,
Can you please give to get the discription of each filds in table formate ..This will be very useful for us .
Thanks
Anjin