@@ -86,6 +86,26 @@ public class RemoteTKController {
86
86
return null ;
87
87
}
88
88
89
+ private static List <Object > picklistOptions (Schema.DescribeFieldResult field ) {
90
+ List <Object > picklistOptions = new List <Object >();
91
+ Schema .DisplayType fieldType = field .getType ();
92
+ if (fieldType != Schema .DisplayType .Picklist &&
93
+ fieldType != Schema .DisplayType .MultiPicklist &&
94
+ fieldType != Schema .DisplayType .Combobox ) {
95
+ return picklistOptions ;
96
+ }
97
+ List <Schema .PicklistEntry > picklistValues = field .getPicklistValues ();
98
+ for (Schema .PicklistEntry picklistValue : picklistValues ) {
99
+ Map <String , Object > picklistOption = new Map <String , Object >();
100
+ picklistOption .put (' value' , picklistValue .getValue ());
101
+ picklistOption .put (' label' , picklistValue .getValue ());
102
+ picklistOption .put (' active' , picklistValue .isActive ());
103
+ picklistOption .put (' defaultValue' , picklistValue .isDefaultValue ());
104
+ picklistOptions .add (picklistOption );
105
+ }
106
+ return picklistOptions ;
107
+ }
108
+
89
109
@remoteAction
90
110
public static String describe (String objtype ) {
91
111
// Just enough to make the sample app work!
@@ -113,7 +133,8 @@ public class RemoteTKController {
113
133
if (! references .isEmpty ()) {
114
134
field .put (' referenceTo' , references );
115
135
}
116
-
136
+ field .put (' picklistValues' , picklistOptions (descField ));
137
+
117
138
fields .add (field );
118
139
}
119
140
0 commit comments