If we query type field
SELECT Type FROM Task
It will thorough the error as "No such type of column 'Type' on entity 'Task'".
But if we see in the App Setup->Customize->Activities->Task Fields
We will find 'type' field as picklist
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityCheck field level security settings to make sure its not being hidden.
Apex generally runs in system context; that is, the current user's permissions, field-level security, and sharing rules aren’t taken into account during code execution.
If we use "with sharing", still in that case as well as per docs Enforcing sharing rules by using the with sharing keyword doesn’t enforce the user's permissions and field-level security. Apex code always has access to all fields and objects in an organization, ensuring that code won’t fail to run because of hidden fields or objects for a user.
Apr 19, 2013 at 5:30