You need to sign in to do that
Don't have an account?
Palak
Creating the list of fields of contact added to particular layout.
Hi,
I have to create the list of custom as well as some standard fields of contact, which are added to a layout.
I also need to discard standard fields such as createdID etc. and formula fields.
Currently I am using describeSobject and able to retreive all the fields on contacts.
Please help me, it is urgent.
With Regards
Palak Agarwal
Hi Palak,
The below is an example from VF Developer Guide : Chapter "Dynamic Visualforce Bindings"
Thanks,
Devendra
Hi,
You can create a list of string (I.e. fields) which will contain only those fields which you want to show on the VFpage. You have to simply make the condition inside the controller.
Please go through the link below:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_fields_describe.htm
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Thanks S Jain for your reply. The problem I am facing is I am able to retrieve the list of fields through the link you send but I want the list of those fields which are there in a particular layout not all the fields.
I have created a pagelayout for contacts and added few fields on this layout. Now I want the list of only these fields which are present in this layout. Is it possible?
You can't get at that type of information, as Apex doesn't provide access to the metadata API.
This sounds like a case for field sets - you'll have to maintain the list of fields in particular page layout in a separate place, but it does allow changes without writing code.
Here's a blog post of mine that gives an example of using them:
http://bobbuzzard.blogspot.com/2011/02/visualforce-field-sets.html