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
James CollaJames Colla 

Newbie trying to enable Apex Coding

I'm trying to develop an Apex Trigger. I've created a Sandbox environment cause you can't do this directly in production. I've connected my Eclipse IDE to the sandbox (I can run queries on it so i know its connected), but I can't created anything Apex related. I go New -> Apex Trigger and receive this on the popup: "Apex Code is not enabled in this project.  Check permission and connection settings." I've read that some "Author Apex" setting needs to be enabled but I have yet find this option anywhere. I'm a System Administrator so I don't think i lack permissions, but even in the user interface, trying to create a new trigger on an object gives me this:
"Insufficient Privileges. You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. For more information, see Insufficient Privileges Errors."

I don't understand why I can't do anything even in my sandbox environment. Since it fails in the user interface, I believe the hang up is in Salesforce and not my Eclipse environment, but I can't find anything that lets me enable this. Is the "Author Apex" option the only thing I'm missing? Where is it? Shouldn't it be right in the User/Profile settings? And isn't this enabled in Sandbox by default? I thought that was the point to the Sandbox environment. Thanks in advance for any insight.
Mario PariseMario Parise
Hey James

Take a look at the permissions for the object you're working on. Permissions for System Administrators can be a little weird, in that you have permission to give/modify/revoke permissions to yourself. It's entirely possible you're missing a set of permissions on this object or on specific fields.

OR, it's also possible you don't have API access enabled for your profile. From claudElephant (https://developer.salesforce.com/forums/?id=906F000000091FxIAI):

"Go to Setup Menu (Administration Setup) -> Manage Users -> Profiles -> <Select your user profile> -> Administrative Persmissions Section -> Check API Enabled."
James CollaJames Colla
All of this is already set. I have full access to all objects including the one I'm looking to work on. API is also enabled for my profile.
Mario PariseMario Parise
Well, I don't have the answer unfortunately. However, what you might want to try in order to see if the problem is with Eclipse or with Salesforce, is try to setup your org in something other than Eclipse. I still use MavensMate (although it's no longer in development). If you're able to connect your org in MavensMate and create your Apex Trigger class in there, then you at least know the problem is Eclipse. If you can't, you know the problem is somewhere in your salesforce org.

Like I said, it won't solve your problem, but it could help narrow it down.
James CollaJames Colla
I just tried the built in developer console in Salesforce and it won't let me create an Apex class there either. I definitely think the problem is in Salesforce.
James CollaJames Colla
Went back to one of my trailhead playgrounds and found the "Author Apex" option. This option is absent in our production org so I think I'll need to get support from Salesforce itself to fix this problem.
Mario PariseMario Parise
I can't disagree with your logic. Good luck!
James CollaJames Colla
Thank you. Appreciate you taking the time to try and help.