function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

how to use schema object

 i want use schema object

plz give me reference


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}"/>




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;