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
DRSnyderDRSnyder 

Error Deploying Apex Code

I'm trying to deploy three Apex classes to a Configuration-Only sandbox. Two of the classes, MissingValueException and NewLeadContact, are my actual classes. NewLeadContactTest is a UnitTest class, that tests the other two classes. All UnitTests pass and I've got 98% code coverage.

 

Problem is... I'm getting the error messages below.

 

classes/MissingValueException.cls:Not available for deploy for this organization

classes/MissingValueException.cls-meta.xml:Not available for deploy for this organizationclasses/newLeadContact.cls-meta.xml:Not available for deploy for this organization

classes/newLeadContactTest.cls:Not available for deploy for this organization

classes/newLeadContactTest.cls-meta.xml:Not available for deploy for this organization

classes/newLeadContact.cls:Not available for deploy for this organization

 

I'm doing my deployment using the Ant-based Migration Tool. 

 

Here's the line from build.xml where I try and check my deployment...

 

<target name="checkDeployment">

<sf:deploy username="${sf.destinationusername}" password="${sf.destinationpassword}" serverurl="${sf.destinationserverurl}" deployRoot="sourceMetadata" runAllTests="true" checkOnly="true" />

</target>

 

What's wrong, that causes this error message?

Best Answer chosen by Admin (Salesforce Developers) 
Anand@SAASAnand@SAAS
Have you tried to deploy using the force.com IDE. You should be able to select the class/triggers and do "deploy to server" and deploy to sandbox or production environment. It's possible that the error might be user security or org settings related.

All Answers

Anand@SAASAnand@SAAS
Have you tried to deploy using the force.com IDE. You should be able to select the class/triggers and do "deploy to server" and deploy to sandbox or production environment. It's possible that the error might be user security or org settings related.
This was selected as the best answer
DRSnyderDRSnyder
Turns out that the account I was using for doing the deployment didn't have the "Author Apex" administrative permission. Once I gave them that permission, things worked beautifully.