• Nisha Radha
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
Season southernHemisphereSeason = Season.WINTER;

public Season getSouthernHemisphereSeason(Season northernHemisphereSeason) {

    if (northernHemisphereSeason == Season.SUMMER) return southernHemisphereSeason;
     //...
}

This is a sample code I found in Salesforce.developer.com. How do I call the method getSouthernHemisphereSeason as it accepts parameter of type Season? When I tried am getting error variable season is not defined
I have a position custom object and there have related job applications for the position. I need to do a mass update the status field of the selected application. I am expecting a page like this to select the job applications for update
User-added image


But I dont see the checkbox next to my job applications. 
I have created button with multiselect and gave visualforce page as content.

The following is the visualforce code
<apex:page standardController="Job_Application__c" recordSetVar="applications">
    <apex:sectionHeader title="Mass Update the Status of Job Applications"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Change" collapsible="false">
                <apex:inputField value="{!Job_Application__c.Status__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Selected Applications" columns="1">
                <apex:pageBlockTable value="{!selected}" var="application">
                    <apex:column value="{!application.name}"/>
                    <apex:column value="{!application.position__r.name}"/>
                    <apex:column headerValue="Candidate Name">
                        <apex:outputText value="{!application.candidate__r.First_Name__c & ' ' & application.candidate__r.Last_Name__c}"/>
                    </apex:column>
                    <apex:column value="{!application.Status__c}"/>                    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

This is what I see when I go to position related list. There is no checkbox to select multiple job applications
User-added image
I am new to salesforce, as part of assignment, I am trying to incorporate a google map which shows location of candidates applied for a position. 

Below is the visual force code for that.

<apex:page standardcontroller="Position__c">

    <p>This map shows the locations of candidates who have 
       applied for the {!Position__c.Name} position.</p>

    <!-- For development use only.
         Add a Google API key to use in production. See 
         https://developers.google.com/maps/documentation/javascript/tutorial 
         for details of how to obtain a Google API key. -->
    <apex:includeScript value="https://maps.googleapis.com/maps/api/js"/>
    
    <script type="text/javascript">
        var applicants = [];
        var countApplicantsGeocoded = 0;
        var map;
        var mapBoundary;
        var geocoder;
        var applicantInfoPanel = new google.maps.InfoWindow();
        
        function loadMap() {
            var mapCanvas = document.getElementById('{!$Component.mapContainer}');
            var mapOptions = {
                center: { lat: 40, lng: -95 },
                zoom: 4,
                maxZoom: 10,
                scrollwheel: false
            };
            map = new google.maps.Map(mapCanvas, mapOptions);
            mapBoundary = new google.maps.LatLngBounds();
                   
            loadApplicants();
            plotApplicantMarkers();
        }
        
        // Convert applicants from sObjects to JavaScript objects
        function loadApplicants() {
            <apex:repeat value="{!Position__c.Job_Applications__r}" var="jobApp">
                applicants.push({ 
                    name: "{!JSENCODE(jobApp.Candidate__r.First_Name__c + ' ' + 
                                     jobApp.Candidate__r.Last_Name__c)}",
                    address: "{!JSENCODE(jobApp.Candidate__r.Street__c  + ', ' + 
                                        jobApp.Candidate__r.City__c + ', ' + 
                                        jobApp.Candidate__r.State_Province__c)}",
                    viewLink: "{!JSENCODE(LINKTO(jobApp.Candidate__r.First_Name__c + 
                                           ' ' + jobApp.Candidate__r.Last_Name__c, 
                                        $Action.Candidate__c.View, 
                                        jobApp.Candidate__c))}"
                });
            </apex:repeat>
        }
        
        // Place markers on the map for each applicant
        function plotApplicantMarkers() {
            geocoder = new google.maps.Geocoder();
            for(var idex = 0 ; idex < applicants.length ; idex++) {
                geocodeAndCreateMarker(applicants[idex]);
            }
        }
        
        // Convert address to lat & long, and create actual marker
        function geocodeAndCreateMarker(applicant) {
            geocoder.geocode({'address':applicant.address},function(results, status){

                countApplicantsGeocoded++;

                // Add marker for geocoded address
                if(status == google.maps.GeocoderStatus.OK) {
                    var marker = new google.maps.Marker({
                        map: map,
                        position: results[0].geometry.location,
                    });
                    mapBoundary.extend(marker.position);
                    
                    google.maps.event.addListener(marker, 'click', function() {
                        applicantInfoPanel.setContent(applicant.viewLink + 
                            "<br/>\n" + applicant.address);
                        applicantInfoPanel.open(map, marker);
                    });
                }
                
                // If we're done geocoding, re-center and zoom the map
                if(countApplicantsGeocoded >= applicants.length) {
                    map.fitBounds(mapBoundary);
                }
            });
        }
        
        google.maps.event.addDomListener(window, 'load', loadMap);
    </script>

    <apex:outputPanel layout="block" id="mapContainer" style="height: 400px">
        Loading map...
    </apex:outputPanel>

</apex:page>User-added image
I am facing a situation like this. I am creating a New record in a custom object. Email Id is a field of that. While creating this I need to check if the there is already an existing record in that object with same email id, if so I need to check the checkbox. I need to implement it using a flow. The issue in the get records, flow is fetching my present record and since email id is already there, it checks the check box. I need to avoid the new record i am inputting and search only all other records in the system. I tried by using id doesnot equal {!$Record.Id}. But it is still fetching the record and always checking the checkbox 
Season southernHemisphereSeason = Season.WINTER;

public Season getSouthernHemisphereSeason(Season northernHemisphereSeason) {

    if (northernHemisphereSeason == Season.SUMMER) return southernHemisphereSeason;
     //...
}

This is a sample code I found in Salesforce.developer.com. How do I call the method getSouthernHemisphereSeason as it accepts parameter of type Season? When I tried am getting error variable season is not defined
Hello-
We created a Visualforce page for Google Maps in our instance back in June of 2014 and it has worked perfectly until today when we started receiving the "Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details." error on every account using this page layout. I'm not sure if it has anything to do with us receiving the Spring 17 release over this past weekend. I did notice that when I went into the page detail of the Visualforce page that the API version is 30.0. All throughout the Spring 17 Release Notes it talks about version 39.0. Could this be my issue? Would a solution be to delete the Visualforce page and create it again? Would it automatically use version 39.0 when I create it? Just a few questions. Any help would be greatly appreciated. 

Thank you,
Kim