function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Error: schema.sobjectfield not a valid type

Not able to use
Schema.DescribeFieldResult f = Schema.sObjectType.Account.fields.Name;
in an apex code.
I want to store the field name in a variable and use it in SOQL to make it dynamic
I have noticed that same issue.  It may be that DescribeFieldResult is only introduced in Summer '08, so the docs refer to it now but Summer '08 is still rolling out.  Do you see this issue on a stack that's already on Summer '08 (i.e. NA0 or NA1 or CS0 or CS2)?

From I tip off, it was suggested that dynamic Apex has to be enabled for an Org.

I am not sure if this is true. I have already logged a case with SFDC support to enble this feature if possible.