You need to sign in to do that
Don't have an account?
Geoff Spozetta
Method does not exist or incorrect signature with controller creation
Hi All,
I'm currently following through a tutorial on how to display some records; I've gotten to a point where I've written the following Controller however I'm running into the following error:
Error: Compile Error: Method does not exist or incorrect signature: Database.getQueryLocater(List<innovation_orders__c>) at line 7 column 61. Full code code is below but the offending line is:
My Code:
For reference, the sample code I'm trying to edit for my own purposes is:
I'm currently following through a tutorial on how to display some records; I've gotten to a point where I've written the following Controller however I'm running into the following error:
Error: Compile Error: Method does not exist or incorrect signature: Database.getQueryLocater(List<innovation_orders__c>) at line 7 column 61. Full code code is below but the offending line is:
orderdets = new ApexPages.StandardSetController(Database.getQueryLocater(
My Code:
public class InnovationOrderingController { //ApexPages.StandardSetController must be instantiated //For standard list controllers public ApexPages.StandardSetController orderdets { get{ if(orderdets == null) { orderdets = new ApexPages.StandardSetController(Database.getQueryLocater( [SELECT Additional_Comments__c, Construction_Type__c, Contract_Signed_Date__c, CSA_ID__c, customer_site_id__c, Location_ID__c, Order_Completion_Date__c, Order_Status__c, Order_Type__c, Product_Instance_Number__c, Requested_Speed__c, Requested_Start_Date__c, Service_Status__c, site_name__c FROM innovation_orders__c])); } return orderdets; } set; } //Initalize orderdets and return a list of records public List<innovation_orders__c> getOrderDets() { return (List<innovation_orders__c>) orderdets.getRecords(); } }
For reference, the sample code I'm trying to edit for my own purposes is:
public class opportunityList2Con { // ApexPages.StandardSetController must be instantiated // for standard list controllers public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator( [SELECT Name, CloseDate FROM Opportunity])); } return setCon; } set; } // Initialize setCon and return a list of records public List<Opportunity> getOpportunities() { return (List<Opportunity>) setCon.getRecords(); } }
--Richard
All Answers
Interestingly, this is working for the sample example on Opportunity object provided under the heading of "Building a Custom List Controller" in Visualforce Developer Guide. I think there are some issues.
Please let us know if this will help you
What issue you are facing?
-thanks
Ashlekh Gera
--Richard
--Richard
Thanks Richard, you're a life saver :)
Regards,
Page currently looks like this and the controller has not been altered from my first post:
Cheers,
Geoff
If that doesn't work, expose it like this: Then iterate {!Orders} in your pageBlockTable.
Hope that helps.