• Sameer Prasonn
  • NEWBIE
  • 335 Points
  • Member since 2014
  • Certified Salesforce Developer
  • Helios Web Services

  • Chatter
    Feed
  • 4
    Best Answers
  • 1
    Likes Received
  • 7
    Likes Given
  • 2
    Questions
  • 48
    Replies
i want to coverage following lines to coverage into Test class.

   Id= Apexpages.currentPage().getParameters().get('delId2');
  productId= Apexpages.currentPage().getParameters().get('productId2');

Thanks in Advance.
 
I have a nested list issue. I have two lists of IDs and I'm trying to combine them into one list so I can return the list and then split it back out after it is returned. This is what I have.

List<List<ID>> AllIDLists = New List<List<ID>>();
AllIDLists.add(mailToIds);
AllIdLists.add(WhatOppIDs);
Return AllIdLists;

So first I'm not sure that the list definition is correct. The definition should accomodate basically one list that contains 2 lists. 
My second question is then what is the best way to split the lists back out. My code for that is below.

List<ID> oppIdsList = New List<ID>{AllIdLists.get(0)};
List<ID> whatIdsList = New List<ID>{AllIdLists.get(1)};

Any help on what I am doing wrong here is appreciated. 
Hi members ,

i have written a trigger on the oppportunity in the object if the stage is "closed won " i need to insert a record in the account.and i m getting the error and the error is (Error:Apex trigger opptrigger caused an unexpected exception, contact your administrator: opptrigger: execution of AfterUpdate caused by: System.DmlException: Upsert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Account Name]: [Account Name]: Trigger.opptrigger: line 23, column 1)




trigger opptrigger on Opportunity (after insert,after update)
{
      //Create a list to hold all new records  
   List<Account> newRecords = new List<Account>();
  
    //Loop around all records in the trigger transaction 
    for(Opportunity theRecord : Trigger.new)
{
          //Evaluate the record against our critieria    
     if(theRecord.StageName == 'Closed Won')
{
              //The line below creates a new Account record and adds it to our list of new records. Add your field assigments (examples below). Make sure to assign all required fields.          
   Account newRecord = new Account();           
  //newRecord.Name = theRecord.name;        
     //newRecord.Description = 'My New Record';           
  newRecords.add(newRecord);       
   }   
  }     
//Insert the new records if any exist   
  if(newRecords.size() > 0)    
     upsert newRecords;
}
Hi All,

What is "MIXED_DML_OPERATION"? and when it encountered? how to resolve this error? 

Thank you in advance.
I need to prepare result pagination. I must keep records limit to 100 for each page and once i'm done and click next It must  fetch next 100 records and display next 100 records. I'm on the same. If any one can help that would be great Thank you in advance.
Hi All,

What is "MIXED_DML_OPERATION"? and when it encountered? how to resolve this error? 

Thank you in advance.
I have wriiten a test class for apex class.i got 89% but for loop is not covered.please see the screenshot for clarification.how to cover' for loop' and improve code coverage?
apex class:
public with sharing class Rfleet_Commericialcondition {
    //Variable Declaration Parts
    public List < RFLEET_Protocol_Grid__c > contt {get;set;}
    public List < EditableContact > myAssociatedContact {get;set;}
    public Integer editableContactNumber {get;set;}
    public Boolean refreshPage {get;set;}
    public String protocolname {get;set;}
    String id;
    //Constructor for invoking the Records from Protocol Grid Object
    public Rfleet_Commericialcondition(ApexPages.StandardController stdCtrl) {
            id = ApexPages.currentPage().getParameters().get('id');
            myAssociatedContact = new List < EditableContact > ();
            Integer counter = 0;
            RFLEET_Protocol__c conn = [select name from RFLEET_Protocol__c where id = : id];
            protocolname = conn.name;
            contt = [select id, Name, Rfleet_Type_of_Grid__c, Rfleet_Type_of_Sales__c, Rfleet_Protocol__c from RFLEET_Protocol_Grid__c where Rfleet_Protocol__r.name = : protocolname];

            for (RFLEET_Protocol_Grid__c myContact: contt) {
                myAssociatedContact.add(new EditableContact(myContact, false, counter));
                counter++;
            }
        }
        // This method is used for deleting the Row
    public void deleteRowEditAction() {
        try {
            myAssociatedContact.get(editableContactNumber).editable = false;
            delete(myAssociatedContact.get(editableContactNumber).myContact);
        } catch (Exception e) {}
        refreshPage = true;
    }
    public class EditableContact {
        public RFLEET_Protocol_Grid__c myContact {get;set;}
        public Boolean editable {get;set;}
        public Integer counterNumber {get;set;}
        public EditableContact(RFLEET_Protocol_Grid__c myContact, Boolean editable, Integer counterNumber) {
            this.myContact = myContact;
            this.editable = editable;
            this.counterNumber = counterNumber;
        }
    }
}
test class:
@isTest
public class Rfleet_Commercialcondition_Test {
    @isTest Static void Testcommercial(){
       
         RFLEET_Protocol_Grid__c myContact = new RFLEET_Protocol_Grid__c (Name='testing');
           insert myContact;
             myContact.Rfleet_Input_Mode__c = 'manually';
        update myContact;
            
            String Name = 'ListConditionCheck';
            Boolean editable; 
            Integer counterNumber;
            Boolean refreshPage;
            Integer editableContactNumber;        
            Rfleet_Commericialcondition.EditableContact wra= new Rfleet_Commericialcondition.EditableContact(myContact, editable, counterNumber);
            RFLEET_Protocol__c test = new RFLEET_Protocol__c(Name='prabu');
            insert test;
            test.Name = 'prabu';
            update test;
            System.debug('Before Query');
          
           
            RFLEET_Protocol__c myCondtest = new RFLEET_Protocol__c();
            myCondtest = [select id,Name from RFLEET_Protocol__c LIMIT 1];
            PageReference vfpage = Page.Rfleet_Commericialcondition;
            System.test.SetCurrentpage(vfpage);
            Apexpages.currentPage().getparameters().put('id',myCondtest.id);
            System.assertEquals(myCondtest.id,ApexPages.currentPage().getParameters().get('id'));
            Apexpages.StandardController sc = new Apexpages.StandardController(myCondtest);
            Rfleet_Commericialcondition commtest = new Rfleet_Commericialcondition(sc);
            commtest.deleteRowEditAction();
            System.assertEquals('prabu',test.Name);
        
               
    }
    
}
red color mark in test class

 
Hai Guys.
I want to know how to insert a records in 2  custom objects by using custom controller and visual force page those two objects have lookup relation ship plesase tell i am new to salesforce
Hello guys

I have code that automatically generates leads from my email. Now what I need is something that can inform the sender that their query is being processed. Now I have created a tigger to send the response but it doesnt seem to work. Is there something I am missing?
 
trigger EmailToLeadResponseTrigger on Lead (after insert) {
	final String template = 'SalesLeadCreatedWebInquiries';
    Id templateId;
    
    try {
    templateId = [SELECT id FROM EmailTemplate WHERE Name = :template].id;
    } catch (QueryException e) {
    //...handle exception if no template is retrieved, or create condition to set email body in code
    }
    List<Messaging.SingleEmailMessage> messages = new List<Messaging.SingleEmailMessage>();
    //Send a single mail to contact each created lead
    for (Lead l : [SELECT Name, Lead.Email FROM Lead WHERE Id in :Trigger.new]) {
        Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
        
        message.setTemplateId(templateId);
        message.setTargetObjectId(l.Id);
        message.setWhatId(l.Id);
        message.setToAddresses(new String[] {l.Email});
        messages.add(message);
    }
    
}

 
I have create pageblocksection with 3 columns and i would like to reduce the cell spacing in visualforce page. how to reduce the cell space in vf page
HI Experts,

while posting my code in developers community, getting this error what does it mean by."The operation is not permitted. If you received this in error, please contact info@developerforce.com (code: B2)"
Looking for help to get my test class working properly. The Code, Trigger, and Test class are listed below... Thanks in advance.
 
/*  TEST CLASS FOR QuoteTriggerHandler TO ASSESS HANDLING OF UPDATES TO
    BILL TO AND SHIP TO ACCOUNTS, CONTACTS, AND ADDRESSES

    - John Scardino, 2015-05-28
*/


@isTest     // test classes need the @isTest classification

private class QuoteTriggerHandlerTest {

    static testMethod void insertNewQuoteTest() {
        // select account to add a new opportunity towards
        Account newAccountJawn = new Account(Name='Jawn', Phone='(555) 555-5555',
            Customer_Class__c='Defense Industry', Entity_Type__c='Domestic');
        insert newAccountJawn;

        // create new opportunity on the account
        //      -> reference new op id on the new quote
        Opportunity newOpportunityJawn = new Opportunity(/*RecordType='Transactional Opportunity',*/CloseDate=date.Today(), StageName='Quoted', Name='Test Op', Account=[SELECT Id FROM Account WHERE Id= :[SELECT Id FROM Account WHERE Id= :newAccountJawn.Id]]);
        insert newOpportunityJawn;

        // create new contact on the account
        //      -> reference new contact id on the new quote
        Contact newContactJawn = new Contact(LastName='Aaron', Account=[SELECT Id FROM Account WHERE Id= :newAccountJawn.Id]);
        insert newContactJawn;

        // create new BILL TO address on the account
        //      -> reference new bill to address id on the new quote
        Address__c newBillingAddressJawn = new Address__c(Account_Name__c=[SELECT Id FROM Account WHERE Id= :newAccountJawn.Id],
            Address_Line_1__c='Apple Inc.', Address_Line_2__c='1 Infinite Loop', City__c='Cupertino', State_Code__c='CA', Postal_Code__c='95014', Postal_Code_Extension__c='2083', Country_Code__c='US', Type__c='Billing');
        insert newBillingAddressJawn;

        // create new SHIP TO address on the account
        //      -> reference new ship to address id on the new quote
        Address__c newShippingAddressJawn = new Address__c(Account_Name__c=[SELECT Id FROM Account WHERE Id= :newAccountJawn.Id],
            Address_Line_1__c='621 Lynnhaven Pkwy', Address_Line_2__c='Ste 400', City__c='Virginia Beach', State_Code__c='VA', Postal_Code__c='23452', Country_Code__c='US', Type__c='Shipping');
        insert newShippingAddressJawn;

        // create new quote
        //      <- include new id values for lookup fields to opportunity, contact, bill to and ship to
        SBQQ__Quote__c newQuoteJawn = new SBQQ__Quote__c(SBQQ__Opportunity__c=[SELECT Id FROM Opportunity WHERE Id= :newOpportunityJawn.Id],
            SBQQ__Type__c='Quote', SBQQ__Status__c='Draft', Contract__c=[SELECT Id FROM Contract__c WHERE Id= :newContactJawn.Id],
            Bill_To_Address__c=[SELECT Id FROM Address__c WHERE Id= :newBillingAddressJawn.Id], Ship_To_Address__c=[SELECT Id FROM Address__c WHERE Id= :newShippingAddressJawn.Id], Bill_To_Contact__c=[SELECT Id FROM Contact WHERE Id= :newContactJawn.Id], Ship_To_Contact__c=[SELECT Id FROM Contact WHERE Id= :newContactJawn.Id], Bill_To_Account__c=[SELECT Id FROM Account WHERE Id= :newAccountJawn.Id], Ship_To_Account__c=[SELECT Id FROM Account WHERE Id= :newAccountJawn.Id]);
        insert newQuoteJawn;

        // inserting the above quote should have fired off the trigger to this point
        //      the following lines are verification steps to ensure the trigger worked correctly

        SBQQ__Quote__c quoteValuesTest = [SELECT Id, Bill_To_Contact_Name__c, Ship_To_Contact_Name__c,
            Bill_To_Account_Name__c, Ship_To_Account_Name__c, SBQQ__BillingStreet__c, Bill_To_Street_Line_2__c, SBQQ__BillingCity__c, SBQQ__BillingState__c, SBQQ__BillingPostalCode__c, SBQQ__BillingCountry__c, SBQQ__ShippingStreet__c, Ship_To_Street_Line_2__c, SBQQ__ShippingCity__c, SBQQ__ShippingState__c, SBQQ__ShippingPostalCode__c, SBQQ__ShippingCountry__c FROM SBQQ__Quote__c WHERE id= :newQuoteJawn.Id];

        // test contact name
        System.assert(quoteValuesTest.Bill_To_Contact_Name__c == newContactJawn.Name);
        System.assert(quoteValuesTest.Ship_To_Contact_Name__c == newContactJawn.Name);

        // test account name
        System.assert(quoteValuesTest.Bill_To_Account_Name__c == newAccountJawn.Name);
        System.assert(quoteValuesTest.Ship_To_Account_Name__c == newAccountJawn.Name);

        // test billing address information
        System.assert(quoteValuesTest.SBQQ__BillingStreet__c == newBillingAddressJawn.Address_Line_1__c);
        System.assert(quoteValuesTest.Bill_To_Street_Line_2__c == newBillingAddressJawn.Address_Line_2__c);
        System.assert(quoteValuesTest.SBQQ__BillingCity__c == newBillingAddressJawn.City__c);
        System.assert(quoteValuesTest.SBQQ__BillingState__c == newBillingAddressJawn.State_Code__c);
        System.assert(quoteValuesTest.SBQQ__BillingPostalCode__c == newBillingAddressJawn.Postal_Code__c && '-' && newBillingAddressJawn.Postal_Code_Extension__c);
        System.assert(quoteValuesTest.SBQQ__BillingCountry__c == newBillingAddressJawn.Country_Code__c);

        // test shipping address information
        System.assert(quoteValuesTest.SBQQ__ShippingStreet__c == newShippingAddressJawn.Address_Line_1__c);
        System.assert(quoteValuesTest.Ship_To_Street_Line_2__c == newShippingAddressJawn.Address_Line_2__c);
        System.assert(quoteValuesTest.SBQQ__ShippingCity__c == newShippingAddressJawn.City__c);
        System.assert(quoteValuesTest.SBQQ__ShippingState__c == newShippingAddressJawn.State_Code__c);
        System.assert(quoteValuesTest.SBQQ__ShippingPostalCode__c == newShippingAddressJawn.Postal_Code__c && '-' && newShippingAddressJawn.Postal_Code_Extension__c);
        System.assert(quoteValuesTest.SBQQ__ShippingCountry__c == newShippingAddressJawn.Country_Code__c);

    }
}

 
i want to coverage following lines to coverage into Test class.

   Id= Apexpages.currentPage().getParameters().get('delId2');
  productId= Apexpages.currentPage().getParameters().get('productId2');

Thanks in Advance.
 
Hi,
i'm tryng access to report (standard and custom) via SoapClient in WebApp c#.

Some IDEA?????? plz

Tnk
hi
i want autocomplete functionality on lookup field.
So i wrote jquery for autocomplete.
when i tried to use in apex:inputField it is not working.
 In apex:inputText it is working.But the problem is it is displaying id of the record and not the name.
When using in apex:inputField the lookup is showing like this..
[User-added image]
Code Snipprt:
<script type="text/javascript">  
        var jq = jQuery.noConflict();   
        var apexACList =[];               
        <apex:repeat value="{!listAC}" var="ACList">          
            apexACList.push('{!ACList.WS_User__r.name}');         
        </apex:repeat> 
        jq(document).ready(function(){ 
            jq(".acautocomplete").autocomplete({
                source : apexACList 
            }); 
            
        }); 
<apex:inputField value="{!relList.Person__c}" styleClass="acautocomplete"   />
Can anybody help me on this..
Hello!

Here's my code to update a lookup field value (Campagna_Account__c) on an Account object using a trigger that update it getting the value from a custom object (Sottocampagna__c):
trigger PopolaCampagna on Account (before insert, before update) {

    Sottocampagna__c var = [

        SELECT Campagna__r.Id
        FROM Sottocampagna__c
        WHERE Name='Segugio'
   
    ];

   for (Account a: Trigger.new) {
   a.Campagna_Account__c = var.Campagna__r.Id;

}

Now my question is: how can I substitute the value 'Segugio' with a variable that pick up the value of a particular field on Account object called Sottocampagna__r.Name?

I'm a newbie, and your answer let me learn tons of things...

Thank you so much
 
Hi.

In the VF I used the date format as YYYY-MM-dd in the 
<apex:outputText value="{0,date,YYYY/MM/dd}">
Before the last week of the year it was OK. When the new year falls in the  last week of Decemeber comes the issue.
For example
2014:
S   M  T  W Th F Sat
28 29 30 31 1   2 3

In the above calendar 1st Jan of 2015 falls in the Thurusday.So when I viewd the records of 28,29,30 of December 2014 It showed as
2015-12-28
2015-12-29
2015-12-30
2015-12-31

After that I came to know that
@"YYYY" is week-based calendar year.
@"yyyy" is ordinary calendar year.
http://realmacsoftware.com/blog/working-with-date-and-time

cheers
suresh



 
I need to prepare result pagination. I must keep records limit to 100 for each page and once i'm done and click next It must  fetch next 100 records and display next 100 records. I'm on the same. If any one can help that would be great Thank you in advance.
I have a nested list issue. I have two lists of IDs and I'm trying to combine them into one list so I can return the list and then split it back out after it is returned. This is what I have.

List<List<ID>> AllIDLists = New List<List<ID>>();
AllIDLists.add(mailToIds);
AllIdLists.add(WhatOppIDs);
Return AllIdLists;

So first I'm not sure that the list definition is correct. The definition should accomodate basically one list that contains 2 lists. 
My second question is then what is the best way to split the lists back out. My code for that is below.

List<ID> oppIdsList = New List<ID>{AllIdLists.get(0)};
List<ID> whatIdsList = New List<ID>{AllIdLists.get(1)};

Any help on what I am doing wrong here is appreciated. 
I have a custom button on my Account object that uses OnClick Javascript to display a modal popup.  Currently in the Javascript, from that modal popup, the "Run Tool" button executes a VF page passing in the Account.Id.  I have a picklist on the modal popup with related Accounts.  What I need to do is pass the related Account Id that is selected in picklist into my Javascript to be able to execute my VF page for whatever Account Id is selected. The Related Account Ids are custom fields on the Account object.  I haven't had any luck finding an example of how to pass the picklist value from the child/modal popup back to the Javascript in the OnClick code.  Is this even possible?

User-added image

OnClick Javascript
{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js')}
{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js')}

var j$ = jQuery.noConflict();
try{
  j$(function() {
    /*Append the jQuery CSS CDN Link to the Head tag.*/
    j$('head').append('<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/start/jquery-ui.css" type="text/css" />');
    
    /*Create the HTML(DIV Tag) for the Dialog.*/
    var html = '<div id="dialog" title="Select account to run"><p>Do you want to go to the Home tab ?</p></div>';
    
    /*Check if Dialog(DIV Tag) already exists if not Append same to the Body tag.*/
    if(!j$('[id=dialog]').size()){
      j$('body').append(html);
    }    

    var iframe_url = '{!URLFOR("/apex/ProductPenetrationPopup?id="+Account.Id )}'
    var tool_url = '{!URLFOR("/apex/ProductPenetration?id="+Account.Id )}'

    /*Open the jQuery Dialog.*/ 
    j$( "#dialog" ).html('<iframe id="iframeContentId" src="' + iframe_url + '" frameborder="0" height="100%" width="100%" marginheight="0" marginwidth="0" scrolling="no" />')
     .dialog({
      autoOpen: true,
      modal: true,
      resizable: false,
      width: 500,
      height: 300,
      show: {duration: 10},
      hide: {duration: 10},
      buttons: {
        "Run Tool": function() {
         window.location = tool_url; /*currently runs Product tool using the Account.ID*/
          j$( this ).dialog( "close" );
        },
        Cancel: function() {
          j$( this ).dialog( "close" );
        }
      }
    });
  }); 
}
catch(e){
alert('An Error has Occured. Error: ' + e);
}

VF Page
<apex:page standardController="Account" showChat="false" sidebar="false" showHeader="false" extensions="ProductPenetrationContExt" title="testing">   
    <apex:form > 
          <apex:pageBlock >
                <apex:pageBlockSection >                       
                      <apex:outputField value="{!Account.Last_Sale_Date__c}" rendered="false"/>                     
                      <apex:outputField value="{!Account.name}"/>
                      <apex:outputField value="{!Account.Customer_ID__c}"/>       
                      <apex:outputField value="{!Account.Winning_Relationship_Number__c}"/>
                      <apex:outputField value="{!Account.Winning_Relationship__c}" rendered="false"/>
                      <apex:outputField value="{!Account.Uplink_Number__c}" rendered="false"/>
                      <apex:outputField value="{!Account.Uplink_Name__c}"/>
                      <apex:outputField value="{!Account.TL_Number__c}" rendered="false"/>
                      <apex:outputField value="{!Account.TL_Name__c}"/>
                      <apex:outputField value="{!Account.WA_Number__c}" rendered="false"/>
                      <apex:outputField value="{!Account.WA_Name__c}"/>
                </apex:pageBlockSection>
         </apex:pageBlock>        
         <apex:pageBlock >
         <apex:pageBlockSection columns="1">
				<apex:pageBlockSectionItem >
					<apex:outputLabel value="Accounts" for="listAccounts"></apex:outputLabel>
					<apex:selectList id="listAccounts" title="Accounts" size="1" multiselect="false">
						<apex:selectOptions value="{!Ids}"></apex:selectOptions>
					</apex:selectList>
				</apex:pageBlockSectionItem>
	     </apex:pageBlockSection>
     </apex:pageBlock>
    </apex:form>   
</apex:page>

Any help would be greately appreciated.

Thanks,

Tim Johnson
Hi,
 
I was just wondering why the following code might not work? I'm working through eclipse; which isn't reporting an error, but when I check my account it hasn't been uploaded. When I remove the offending code everything compiles fine and I can see it in my force account.
 
Code:
[Select l.Boat__c, l.List_Price__c, l.Listing_Type__c, l.Name, l.RecordTypeId from Listing_Details__c l where l.boat__c =:myBoat AND l.RecordTypeId = 'foo'].List_Price__c);

 
myBoat is a string that holds the id.
 
Thanks for any help.
Hello guys

I have code that automatically generates leads from my email. Now what I need is something that can inform the sender that their query is being processed. Now I have created a tigger to send the response but it doesnt seem to work. Is there something I am missing?
 
trigger EmailToLeadResponseTrigger on Lead (after insert) {
	final String template = 'SalesLeadCreatedWebInquiries';
    Id templateId;
    
    try {
    templateId = [SELECT id FROM EmailTemplate WHERE Name = :template].id;
    } catch (QueryException e) {
    //...handle exception if no template is retrieved, or create condition to set email body in code
    }
    List<Messaging.SingleEmailMessage> messages = new List<Messaging.SingleEmailMessage>();
    //Send a single mail to contact each created lead
    for (Lead l : [SELECT Name, Lead.Email FROM Lead WHERE Id in :Trigger.new]) {
        Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
        
        message.setTemplateId(templateId);
        message.setTargetObjectId(l.Id);
        message.setWhatId(l.Id);
        message.setToAddresses(new String[] {l.Email});
        messages.add(message);
    }
    
}

 
Hello Salesforce Support Team,

We want to integrate one of the our ASP .Net application with Salesforce.
Our main purpose is to upload documents(generally in excel or csv) from our application to Salesforce Account Documents.

We have followed the steps given in following link but couldn't succeed.
http://danlb.blogspot.in/2012/06/salesforce-rest-api-file-upload.html


Can you please help us and provide guidance regarding detailed steps to upload document through our application to Salesforce Account.

We have developer account in Salesforce.
Hi.

In the VF I used the date format as YYYY-MM-dd in the 
<apex:outputText value="{0,date,YYYY/MM/dd}">
Before the last week of the year it was OK. When the new year falls in the  last week of Decemeber comes the issue.
For example
2014:
S   M  T  W Th F Sat
28 29 30 31 1   2 3

In the above calendar 1st Jan of 2015 falls in the Thurusday.So when I viewd the records of 28,29,30 of December 2014 It showed as
2015-12-28
2015-12-29
2015-12-30
2015-12-31

After that I came to know that
@"YYYY" is week-based calendar year.
@"yyyy" is ordinary calendar year.
http://realmacsoftware.com/blog/working-with-date-and-time

cheers
suresh



 
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

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.