You need to sign in to do that
Don't have an account?
narensfdc
Dynamic Apex for getting the fields of an sobject
Hi,
Please help me in coding for
How to get all the fields of sObject using dynamic Apex?(complete code) --- like for account object
Thanks.
Class:
Try this.
All Answers
Hi,
Your requirement is not clear. Hopefully the below link will helps you.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic.htm
Thanks,
Babu.
Hi
My requirement is using dynamic apex to disply all sobjects on VF page we have the code like
<apex:page controller="dynamic1cls" >
<apex:form >
<apex:pageblock >
<apex:pageblockTable value="{!lst}" var="obj">
<apex:column value="{!obj}"/>
</apex:pageblockTable>
</apex:pageblock>
</apex:form>
</apex:page>
public with sharing class dynamic1cls {
public List<String> lst{get; set;}
public dynamic1cls(){
List<Schema.SobjectType> lstobj = Schema.getGlobalDescribe().values();
lst = new List<String>();
for(Schema.SobjectType s: lstObj)
lst.add(string.valueOf(s));
}
}
In the same way i need to diplay the fields of an Account object on Visualforce page
Please help me out
Thanks.
Class:
Try this.
Hi
Thanks for your reply and the code is fine.
Naren
Hi Naidu,
The code is fine,if we want to display only custom fields,then how to code.
Please help me out.
Thanks,
Naren.
one page I displayed all fields using schema methods(here object name through URL will come like string strtemp = 'rajesh__'+strFieldName + '__c'; )and wrapper class. using wrapper class i gave each field as Edit and Delete command links .When i click delete command link how to delete that delete command link related field from database
Another visualforce page i displayed all Custom objects using schema methods and wrapper class. Using wrapper class i gave each Custom object as Edit and Delete command link .When i click delete command link how to delete that delete command link related object from databse.
please help me...........
Using above code here
lst.add(string.valueOf(s));
How to add object related created dates ?
please help me..............