You need to sign in to do that
Don't have an account?
Arun Chaubey
Error: Compile Error: Invalid type: Warehouse__c at line 7 column 39
Hi friends, I am getting this error " Error: Compile Error: Invalid type: Warehouse__c at line 7 column 39 " while practising the visualforce workbook exercise - Creating the WarehouseUtils Class .
global with sharing class WarehouseUtils { public WarehouseUtils(ApexPages.StandardSetController controller) { } // Find warehouses nearest a geolocation @RemoteAction global static List<Warehouse__c> findNearbyWarehouses(String lat, String lon) { // Initialize results to an empty list List<Warehouse__c> results = new List<Warehouse__c>(); // SOQL query to get the nearest warehouses String queryString = 'SELECT Id, Name, Location__Longitude__s, Location__Latitude__s, ' + 'Street_Address__c, Phone__c, City__c ' + 'FROM Warehouse__c ' + 'WHERE DISTANCE(Location__c, GEOLOCATION('+lat+','+lon+'), \'mi\') < 20 ' + 'ORDER BY DISTANCE(Location__c, GEOLOCATION('+lat+','+lon+'), \'mi\') ' + 'LIMIT 10'; // Run the query results = database.Query(queryString); // Return the query results return(results); } }Anybode help ?
Thanks for your quick reply. Actuualy I have a Warehouse object with Warehouse__c API name, but i deleted that object before, Now my code executes successfully.
All Answers
Thanks for your quick reply. Actuualy I have a Warehouse object with Warehouse__c API name, but i deleted that object before, Now my code executes successfully.
unexpected token: @ at line 4 column 0