You need to sign in to do that
Don't have an account?
NodakPaul
Method does not exist or incorrect signature: [Schema.DescribeFieldResult].isUpdatable()
I am trying to determine if a object field is able to be updated or edited using the Schema.DescribeFieldResult. According to the Language Reference, this should be a valid method:
Field Describe Result Methods
The following table describes the methods available as part of the field describe result. None of the methods takes an argument.
...
isUpdatable Boolean Returns true if the field can be edited by the current user, false otherwise
However, when I try to use the method in my code, I get the following error:
Anyone see what I am doing wrong? FYI, if I insert any other method from the language reference in place of isUpdatable() (like isNillable(), isNameField(), etc), it compiles just fine. What is wrong with this specific method?
Error: Compile Error: Method does not exist or incorrect signature: [Schema.DescribeFieldResult].isUpdatable() |
Code:
Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType leadSchema = schemaMap.get('Lead;); Map<String, Schema.SObjectField> fieldMap = leadSchema.getDescribe().fields.getMap(); for (String fieldName: fieldMap.keySet()) { if (fieldMap.get(fieldName).getDescribe().isUpdatable()) { ... do some logic } }
Anyone see what I am doing wrong? FYI, if I insert any other method from the language reference in place of isUpdatable() (like isNillable(), isNameField(), etc), it compiles just fine. What is wrong with this specific method?
tmatthiesen
This is a doc error. The correct signature is: [Schema.DescribeFieldResult].isUpdateable();