• Evan Burns
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies

I have a controller extension that I built that's used in a VF page. My neophyte question is: do I have to test that APEX class (not just compile) before the VF page can see the class?

Thanks,
 

Evan

I have, with help from the forum, gotten my extended controller to compile. My dumb question is, that extended controller has to now be tested before it can be used by the VF, right?

Just took DEV401 class, so please forgive my newness. There are some questions that I can respond to fortunately, so I will be trying to make a contribution to the forum.

Evan
I have this APEX code for a Contact extended controller. All it does is put a Contact lookup on the VF page, and display the 10 most recent contacts in that lookup.

I have stared at it and stared at it, and I just can't find the error. The error, on line 5, is: expecting a semi-colon, found '('

public class FoodbankContactExtendedController {

    public FoodbankContactExtendedController(ApexPages.StandardController Contact) {
        // Return a list of the ten most recently modified contacts
        public List<Contact> getContacts() {
        return [SELECT Id, Name, Contact.Name, Phone, Email
            FROM Contact
            ORDER BY LastModifiedDate DESC LIMIT 10];
    }

    // Get the 'id' query parameter from the URL of the page.
    // If it's not specified, return an empty contact.
    // Otherwise, issue a SOQL query to return the contact from the
    // database
   
    public Contact getContact() {
    Id id = System.currentPageReference().getParameters().get('id');
    return id == null ? new Contact() : [SELECT Id, Name
        FROM Contact
        WHERE Id = :id];
    }
}

Does anybody have any idea why this simple code won't compile?

Thanks,

Evan
I have this APEX code for a Contact extended controller. All it does is put a Contact lookup on the VF page, and display the 10 most recent contacts in that lookup.

I have stared at it and stared at it, and I just can't find the error. The error, on line 5, is: expecting a semi-colon, found '('

public class FoodbankContactExtendedController {

    public FoodbankContactExtendedController(ApexPages.StandardController Contact) {
        // Return a list of the ten most recently modified contacts
        public List<Contact> getContacts() {
        return [SELECT Id, Name, Contact.Name, Phone, Email
            FROM Contact
            ORDER BY LastModifiedDate DESC LIMIT 10];
    }

    // Get the 'id' query parameter from the URL of the page.
    // If it's not specified, return an empty contact.
    // Otherwise, issue a SOQL query to return the contact from the
    // database
   
    public Contact getContact() {
    Id id = System.currentPageReference().getParameters().get('id');
    return id == null ? new Contact() : [SELECT Id, Name
        FROM Contact
        WHERE Id = :id];
    }
}

Does anybody have any idea why this simple code won't compile?

Thanks,

Evan
I have the following APEX class:

public class ContactExtendedController {
     
       public List<Contact> getContacts() {
            return [SELECT Id, Name, Phone, Email
                FROM Contact
                ORDER BY LastModifiedDate DESC LIMIT 10];
       }
        // Get the 'id' query parameter from the URL of the page.
        // If it's not specified, return an empty contact.
        // Otherwise, issue a SOQL query to return the contact from the
        // database
        
        public Contact getContact() {
        Id id = System.currentPageReference().getParameters().get('id');
        return id == null ? new Contact() : [SELECT Id, Name
            FROM Contact
            WHERE Id = :id];
        }
    
}


And this opening to my VF page errors:

<apex:page standardController="Contact" extensions="ContactExtendedController">

with error: Error: Unknown constructor 'ContactExtendedController.ContactExtendedController(ApexPages.StandardController controller)'


This seems so simple a thing. I can't understand why the "extensions" clause isn't working.

Thanks much,

Evan

I have a controller extension that I built that's used in a VF page. My neophyte question is: do I have to test that APEX class (not just compile) before the VF page can see the class?

Thanks,
 

Evan

I have this APEX code for a Contact extended controller. All it does is put a Contact lookup on the VF page, and display the 10 most recent contacts in that lookup.

I have stared at it and stared at it, and I just can't find the error. The error, on line 5, is: expecting a semi-colon, found '('

public class FoodbankContactExtendedController {

    public FoodbankContactExtendedController(ApexPages.StandardController Contact) {
        // Return a list of the ten most recently modified contacts
        public List<Contact> getContacts() {
        return [SELECT Id, Name, Contact.Name, Phone, Email
            FROM Contact
            ORDER BY LastModifiedDate DESC LIMIT 10];
    }

    // Get the 'id' query parameter from the URL of the page.
    // If it's not specified, return an empty contact.
    // Otherwise, issue a SOQL query to return the contact from the
    // database
   
    public Contact getContact() {
    Id id = System.currentPageReference().getParameters().get('id');
    return id == null ? new Contact() : [SELECT Id, Name
        FROM Contact
        WHERE Id = :id];
    }
}

Does anybody have any idea why this simple code won't compile?

Thanks,

Evan
Hi,

 My requirement is i have two user have same profile and same role, i need give permit for read and write like that to particular tab like account for one user  only,
other user not able to access anything.. how can i do this.. please can any one help me...

Thanks,
kathir