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
Abhilasha_SinghAbhilasha_Singh 

Create Controller

Hi,
I have to  Create the HotelRemoter Controller. For this here is code:

global with sharing class HotelRemoter {
        @RemoteAction
         global static List<Hotel__c> findAll() {
               return [SELECT Id, Name, Location__Latitude__s, Location__Longitude__s
                                             FROM Hotel__c];
         }
 }

I got this error: Error: Compile Error: No such column 'Location__Latitude__c' on entity 'Hotel__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 5 column 16

 
Best Answer chosen by Abhilasha_Singh
Abhi_TripathiAbhi_Tripathi
Recheck your Hotel__c object have Locaton field or not, and Location field should be of type Geolocation.

Then try the query on Developer Console, go to you name --> click "Developer Console"

Check snapshot how to check your query 
User-added image

All Answers

Abhi_TripathiAbhi_Tripathi
Recheck your Hotel__c object have Locaton field or not, and Location field should be of type Geolocation.

Then try the query on Developer Console, go to you name --> click "Developer Console"

Check snapshot how to check your query 
User-added image
This was selected as the best answer
Abhi_TripathiAbhi_Tripathi
User-added image