Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <apex:repeat value='{!fieldList}' var='field'>
  2. console.log('$ObjectType[object].Fields[field].Name} = {!$ObjectType[object].Fields[field].Type}');
  3. </apex:repeat>
  4.  
  5. <apex:repeat value="{!$ObjectType[object].Fields.MyPicklistField__c.picklistValues}" var="val">
  6. </apex:repeat>
  7.  
  8. <apex:page>
  9. {!$ObjectType.Account.Fields.Industry.PicklistValues}
  10. </apex:page>
  11.  
  12. <apex:page controller="picklistentryController">
  13. <apex:repeat value="{!entries}" var="val">
  14. {!val.label}<br/>
  15. </apex:repeat>
  16. </apex:page>
  17.  
  18. public with sharing class picklistentryController
  19. {
  20. //for dynamic vf simply build a map of fieldnames to lists of picklistentries,
  21. public list<Schema.Picklistentry> getEntries(){
  22. return Account.fields.Industry.getDescribe().getpicklistvalues();
  23. }
  24. }
  25.  
  26. class MyController
  27. {
  28. public Map<String, Schema.SObjectType> schemaInfo
  29. {
  30. get { return Schema.getGlobalDescribe(); }
  31. }
  32. }
  33.  
  34. <apex:page controller="MyController">
  35. <apex:repeat
  36. var="pv"
  37. value="{!schemaInfo['MyObject__c'].describe.fields.map['MyPicklistField__c'].describe.picklistValues}"
  38. >
  39.  
  40. {!pv.label}<br/>
  41.  
  42. </apex:repeat>
  43. </apex:page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement