+ Start a Discussion
jayamjayam 

how to use schema object

 i want use schema object

plz give me reference

Pradeep_NavatarPradeep_Navatar

Also go through this is sample code to get picklist values using schema fucntionlity :

 

 

Visual force code:

               <apex:selectList value="{!tgender}" size="1" styleclass="form-select">

               <apex:selectOptions value="{!Gender}"/>

            </apex:selectList>

 

 

Controller code:

 

            public string tgender{get;set;}

            /////*********** Retriving Gender Picklist *****************

                                                public List<SelectOption> getGender()

                                                {

                                                                if(strMsg == null)

                                                                {

                                                                                options2.add(new SelectOption('','SELECT'));

                                                                                Schema.DescribeFieldResult f = Contact.Gender__c.getDescribe();

                                                                                List<Schema.PicklistEntry> ple = f.getPicklistValues();

                                                                                for( Schema.PicklistEntry f1 : ple)

                                                                                {

                                                                                  options2.add(new SelectOption(f1.getValue(),f1.getLabel()));

                                                                                }

                                                                }

                                                                                return options2;

                                                }