You need to sign in to do that
Don't have an account?
Priyanka Reddy 74
How to filter decimal / double data type feilds
Hi All,
Im trying to retrive only Double datatype feilds from Schema.DescribeFieldResult can some one suggest how to filter based on feild datatype and store feild names in list.
Thank you.
Im trying to retrive only Double datatype feilds from Schema.DescribeFieldResult can some one suggest how to filter based on feild datatype and store feild names in list.
String editableFields =' '; List<String> allFieldName = new List<String>(); Map<String, Schema.SobjectField> allMap = Schema.SobjectType.Account.fields.getMap(); for(Schema.SobjectField field : allMap.values()) { Schema.DescribeFieldResult dfr = field.getDescribe(); if(dfr.isCreateable() && dfr.isUpdateable() ){ allFieldName.add(dfr.getName()); editableFields += ','+ dfr.getName(); system.debug(dfr.getName() +' : '+ dfr.getType()); } }
Thank you.
The DescribeFieldResult Class contains getType() method. I recommend using that method. Here is an example code I found online
Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!