• sharath jallu 9
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I created a visualforce page to override the new button of custom object called "Employment History" which is a child object to the standard contact object. I did this in order for the record name (in this case its called employment history name" will be pre-populated with the value "Default Value - IGNORE" so that I could update it with some concatenated field values on the same record using a workflow field update.
I was able to override the new button with a custom visualforce page in order for the record name to be pre-populated but this prevented the master-detail field to the contact object called "Student" from being populated with the parent record when I went to click the new button on the related list located on the contact detail page.
Here is the code I used to override the new button

<apex:page standardController="Employment_History__c" action="{!URLFOR($Action.Employment_History__c.New, null, ['Name'='Default Value - IGNORE'], true)}" />

I would really appreciate it if someone could explain to me how I can set the master detail field on the employment history object equal to the contact ID of the parent contact record.
Hello smart people!

I am a real beginner at saleforce and just cannot seem to get a google map to appear on my custom object.  I cannot for the life of me figure out what I have done wrong.  Do I need a zip code field?

Here is what I have:

<apex:page standardController="Event_Manager__c">

<head>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

  var myOptions = {
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    mapTypeControl: false
  }

  var map;
  var marker;

  var geocoder = new google.maps.Geocoder();
  var address = "{!Event_Manager__c.Street_Address__c}, " + "{!Event_Manager__c.City__c}";

  var infowindow = new google.maps.InfoWindow({
    content: "<b>{!Event_Manager__c.Name}</b><br>{!Event_Manager__c.Street_Address__c}<br>{!Event_Manager__c.City__c}<br>"
  });

  geocoder.geocode( { address: address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK && results.length) {
      if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {

        //create map
        map = new google.maps.Map(document.getElementById("map"), myOptions);

        //center map
        map.setCenter(results[0].geometry.location);

        //create marker
        marker = new google.maps.Marker({
            position: results[0].geometry.location,
            map: map,
            title: "{!Event_Manager__c}"
        });

        //add listeners
        google.maps.event.addListener(marker, 'click', function() {
          infowindow.open(map,marker);
        });
        google.maps.event.addListener(infowindow, 'closeclick', function() {
          map.setCenter(marker.getPosition());
        });

      }

    } else {
      $('#map').css({'height' : '15px'});
      $('#map').html("Oops! {!Event_Manager__c.Name}'s billing address could not be found, please make sure the address is correct.");
      resizeIframe();
    }
  });

  function resizeIframe() {
    var me = window.name;
    if (me) {
      var iframes = parent.document.getElementsByName(me);
      if (iframes && iframes.length == 1) {
        height = document.body.offsetHeight;
        iframes[0].style.height = height + "px";
      }
    }
  }

});
</script>

<style>
#map {
  font-family: Arial;
  font-size:12px;
  line-height:normal !important;
  height:250px;
  background:transparent;
}
</style>

</head>

<body>
<div id="map"></div>
</body>
</apex:page>


Thank you in advance anyone who takes the time to look at this