• Saurav Rajput
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hello Experts,

I have written the following VF Page and its controller, details below :-
VF Page :-

<apex:page controller="HotelRemoter">
    

    <head>
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map-canvas { width:800px;height:600px; }
    </style>
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script>
    var map;
    

    function initialize() {
        var mapOptions = {
            center: new google.maps.LatLng(37.784173, -122.401557),
            zoom: 15
        };
        map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
        loadHotels();
    }
     function loadHotels() {
        Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.AccountRemoter.findAll}',
            function(result, event){
                if (event.status) {
                    for (var i=0; i<result.length; i++) {
                        var id = result[i].Id;
                        var name = result[i].Name;
                        var lat = result[i].Location__Latitude__s;
                        var lng = result[i].Location__Longitude__s;
                        addMarker(id, name, lat, lng);
                    }
                } else {
                    alert(event.message);
                }
            },
            {escape: true}
        );
    }   
        function addMarker(id, name, lat, lng) {
        var marker = new google.maps.Marker({
                position: new google.maps.LatLng(lat, lng),
                map: map,
                title: name
        });
        google.maps.event.addListener(marker, 'click', function(event) {
            window.top.location = '/' + id;
        });
    }
    

    google.maps.event.addDomListener(window, 'load', initialize);
    

    </script>
    </head>
    <body>
      <div id="map-canvas"/>
    </body>
    

    </apex:page>

Controller :-
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];
    }
}

How ever when I am trying to save the VF Page I am getting below error :-

No remoted actions found to resolve '$RemoteAction.AccountRemoter.findAll'

 

Kindly help me in this case. 

Hello all:

 

I would like to require that a user upload an attachment to opportunities before being able to set them to Closed - Won. I am unsure how to implement this in APEX.

 

Any guidance would be greatly appreciated.

 

Thanks.