function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
You can use Schema.SobjectType to get the describe information about object.
By this you can get all the information regarding the object.
// Declare prop to store the selected value public String selfld{get;set;} // Declare a property variable in calss public List<SelectOption> objFields{get; set;} // create memore for this like below in mehtod objFields =new List<SelectOption>(); // add none if needed in Picklist. objFields.add(new SelectOption('-1','--None--')); write below code Map<String,Schema.SObjectType> ssot = Schema.getGlobalDescribe(); Schema.SObjectType sobjType = ssot.get('objectname__c'); Schema.DescribeSObjectResult dsr = sobjType.getDescribe(); Map<String,Schema.SObjectField> obj = dsr.fields.getMap(); for(String fieldName : obj.keyset()) { Schema.SObjectField field = obj.get(fieldName); Schema.DescribeFieldResult fieldDesc = field.getDescribe(); objFields.add(new SelectOption(fieldName.toLowerCase(),fieldName.toLowerCase())); objFields.sort(); }
The VFP code for this picklist:
<apex:pageBlockSection id="pbid" title="title" columns="2"> <apex:pageBlockSectionItem id="pbsitem"> <apex:outputText value="object name"/> <apex:SelectList id="selde" size="1" value="{!selfld}"> <apex:selectOptions value="{!objFields}"/> </apex:SelectList> </apex:pageBlockSectionItem> </apex:pageBlockSection>
Mark it as Solution if it Answers your Question.
Hi,
You can use Schema.SobjectType to get the describe information about object.
By this you can get all the information regarding the object.
The VFP code for this picklist:
Mark it as Solution if it Answers your Question.
Compile Error: unexpected token: '=' at line
which is related to
objFields =new List<SelectOption>();
am i missing something i've just done a copy paste of what your sent.