You need to sign in to do that
Don't have an account?
how to Retrive the picklist values from the picklist field dynamically using if condition
hi i have two fields in my contact object like leadsource and level.
i want to get these values using if condition like
string s='level';
if(type==s)
{
Schema.DescribeFieldResult pickval =Schema.sObjectType.contact.fields.(:s).getSObjectField().getDescribe();
}
i have to mension field name dynamically.
please help me.
Hi,
if(type==s)
{
Schema.DescribeFieldResult pickval =
Schema.getGlobalDescribe().get('contact').getDescribe().fields.getMap().get(s).getDescribe();
}
Hope this helps.