+ Start a Discussion
myfootsmellsmyfootsmells 

Why Can't I Create Custom Controller?

I know I'm missing something but why can't I create a custom controller?

 

<apex:page controller="MyController" > 
<apex:pageBlock title="Contacts">
</apex:pageBlock>
</apex:page>

 

In the tutorial is says if I put that code in a Page and hit save, I'll have a Controller option available but I don't.  I get an error message "Error: Apex class 'MyController' does not exist."  What am I missing here?

 

I'm on SalesForce Pro if that makes a difference.

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Jim BoudreauxJim Boudreaux

you're probably trying to do that in a production org, which is a no-no. You can only create custom controllers in development orgs, or in the sandbox of a production org.

after your custom controller passes 75% of its tests, then you can deploy it to your production org. 

All Answers

Jim BoudreauxJim Boudreaux

you're probably trying to do that in a production org, which is a no-no. You can only create custom controllers in development orgs, or in the sandbox of a production org.

after your custom controller passes 75% of its tests, then you can deploy it to your production org. 

This was selected as the best answer
JimRaeJimRae

It will only work if you are in a development instance, which I don't think that Pro supports.

You could try it by signing up for a developer account, but you will have no way to move your page in to your production instance, since it doesn't appear that Professional supports that.

myfootsmellsmyfootsmells
uggh.  i can't do anything w/ the Pro edition and the price to upgrade is ridiculous.
RyanhRyanh
I think you can move code from a developer edition instance to a production instance (regardless of edition) using the Force.com IDE...