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
Reeses498Reeses498 

Custom Controllers - Help!

I'm nowhere near being a Developer, but I'm walking thru the Visualforce pages tutorial and realize that I cannot create a custom controller.  So, I do this as it says in the tutorial:

 

Create a new Visualforce page, say PageMashup, with the following markup:

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

The first thing you'll note when you save this page is that the system will make a Controller option available in the editor.

 

However, this is what I get when I hit save:

 

Page Editor  

ErrorError: Apex class 'MyController' does not exist 
<apex:page controller="MyController" > <apex:pageBlock title="Contacts"> </apex:pageBlock> </apex:page>
David VPDavid VP

Next to that error message, there should also be a link 'Create Custom Controller' (if you're using the browser based editor).

Click the 'create' link and it'll create an empy controller for you. You'll have to write methods etc... in it yourself though.

 

 

Reeses498Reeses498

I don't see anything about creating a custom controller....I saw a similar link for creating custom components.  I'm on the Professional Edition....does that affect anything?  I realize in my developer account I can create appex classes, but not on our organization's site which is on Professional. 

 

I asked salesforce support and the response was that I could create custom controllers on professional...but i have had no luck

sjfranklinsjfranklin

My guess is that you are using Free Edition, in which case you must first create a Developer Sandbox in order to do any Apex development.  Follow these steps:

 

1. Login to your Force.com Free Edition

2. Go to Setup -> Administration Setup -> Data Management -> Sandbox

3. Click "New"

4. Name the sandbox and save.

5. The sandbox will start copying.  You will need to wait until this is complete.  You will know it is complete when you go to the Sandbox listing, and it has a "Login" link displayed.

6. Once it's displayed, click the "Login" link.  This will log you into your Sandbox.  Your username is appended by sandbox, your password is the same.

7. Now you can create your VisualForce page with a custom controller, and the links should appear to create the custom controller for you.

 

If you have any more comments on Force.com Free Edition, please let me know.  Hope this helps.