You need to sign in to do that
Don't have an account?

How to create a dynamic list?
I want to create a list for eact pick list value,
Some thing lik this below
Schema.DescribeFieldResult ob = object__C.Type__c.getDescribe();
List<Schema.PicklistEntry> ob1 = ob.getPicklistValues();
for(integer i=0;i<ob1.size();i++){
string listname=TokenState[i];
List<Token__C>listname+'list'= new List<Token__C>();
This code is errored out.
Please guide me how to proceed?.
Some thing lik this below
Schema.DescribeFieldResult ob = object__C.Type__c.getDescribe();
List<Schema.PicklistEntry> ob1 = ob.getPicklistValues();
for(integer i=0;i<ob1.size();i++){
string listname=TokenState[i];
List<Token__C>listname+'list'= new List<Token__C>();
This code is errored out.
Please guide me how to proceed?.
Below is the example to get picklist values of a object.
public List<String> technologies {
get {
if (technologies == null) {
technologies = new List<String>();
Schema.DescribeFieldResult field = Contact.interested_technologies__c.getDescribe();
for (Schema.PicklistEntry f : field.getPicklistValues())
technologies.add(f.getLabel());
}
return technologies;
}
set;
}
Regards
SFDC
I want to create a list for each of the pick list value dynamically