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
Geoff SpozettaGeoff Spozetta 

Method does not exist or incorrect signature for record retrieval

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:
 
orderdets = new ApexPages.StandardSetController(Database.getQueryLocater(




 
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();
    }
}


 
Amit Chaudhary 8Amit Chaudhary 8
I hope your this issue is resolved in another post. Use "getQueryLocator" not "getQueryLocater".
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.getQueryLocator(
			[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();
	}
}

Please let us know if you need more help.

Thanks
Amit Chaudhary