• Newbie2013
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies

I am trying to draw a box with css div tag on a visualforce page which is rendered as Word document. 

 

<div style="background: #fff;border: 2px solid black; height: 100px;   margin: 20px;  padding: 20px;  width: 100%;"> 

 

This just generates 2 lines one on top and other on bottom with the lines extending only half way through the word document. Can someone please help me  resolve this issue?

I need the google map to display all members within 10 mi of the current member. I was able to successfully able to display the current member location, can someone please help me beyond that?? Here is the code I am using:

 

<apex:page standardController="Mem__c">

<head>

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=abc&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: 20,
mapTypeId: google.maps.MapTypeId.HYBRID,
mapTypeControl: true
}

var map;
var marker;

var geocoder = new google.maps.Geocoder();
var address = "{!mem__c.Address__c}, " + "{!Mem__c.City__c}, " + "{!Mem__c.Zipcode__c}, ";

var infowindow = new google.maps.InfoWindow({
content: "<b>{!Mem__c.Address__c}, " + "{!Mem__c.City__c}, " + "{!Mem__c.Zipcode__c},"
});

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: "{!Members__c.Name}"
});

//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! {!Members__c.Name}'s 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>

When I try to install this lab : It gives me an error:

 

Package install error
There are problems that prevent this package from being installed.
 
How do I overcome this issue? Please do let me know
Thanks

Is there a way to auto-populate a PDF with fields from Custom Objects

I just designed a VisualForce page from all the tutorials to display member address in google maps within Salesforce.

 

Now, I have another opject which is linked as lookup to the Member object. I just need to display the distance or atleast the two data points on google maps. Can anyone modify my code to help me do this? It would be a great help.

 

<apex:page standardController="Member__c">
 
 <head>

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MY KEY&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: 20,
    mapTypeId: google.maps.MapTypeId.HYBRID,
    mapTypeControl: true
  }
  

  var map;
  var marker;

  var geocoder = new google.maps.Geocoder();
  var address = "{!Member__c.Address__c}, " + "{!Member__c.City__c}, " + "{!Member__c.Zipcode__c}, ";

  var infowindow = new google.maps.InfoWindow({
    content: "<b>{!Member__c.Address__c}, " + "{!Member__c.City__c}, " + "{!Member__c.Zipcode__c},"
  });

  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: "{!Member__c.Name}"
        });

        //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! {!Member__c.Name}'s 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>
I am new to visual force and wanted to see if this concept is possible.

I created two custom object. If a status in one object changes for the record then the record should automatically get converted to the next object. Is that possible for custom objects? Can someone help?
I am trying to implement a next and previous button which when clicked on should display records with the same zip code. Or in other words sort by zip code. This is for a custom object. Can anyone help? I am new to visual force and wanted to see if anyone out there can help me with coding part.

Is there a way to auto-populate a PDF with fields from Custom Objects

I am new to visual force and wanted to see if this concept is possible.

I created two custom object. If a status in one object changes for the record then the record should automatically get converted to the next object. Is that possible for custom objects? Can someone help?

I am trying to plot multiple markers in google maps, getting the data in an array through ajax toolkit. I am preeeetty sure i am making a mistake in handling the results from my soql query. 

 

Can one of you experts tell me what i am doing wrong?

 

<apex:page >
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="/soap/ajax/23.0/connection.js" type="text/javascript" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
        
$(document).ready(function() {


        sforce.connection.sessionId = '{!$Api.Session_ID}';

        // Query data using SOQL.
var records = sforce.connection.query("Select latdecimal__c, londecimal__c from daily__c where vehicle_name__c='a0DM0000000YgEK' order by report_date__c limit 2");
locations = records.getArray("locations");

    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 10,
      center: new google.maps.LatLng(-33.92, 151.25),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    var infowindow = new google.maps.InfoWindow();

    var marker;
    var i;
       
for (i = 0; i < locations.length; i++) {  
      marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][0], locations[i][1]),
        map: map
      });
  
    //add listeners
      google.maps.event.addListener(marker, 'click', (function(marker, i) {
          return function() {
            infowindow.setContent(locations[i][0]);
            infowindow.open(map, marker);
            }
          })(marker,i));
     };
        

  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>

 

Hi,

 

i am not sure how to accomplish and where to start for this requirement. 

 

Use-Case:

 

1) Build a Custom Calendar that would link their activities to a Custom Activity Object. We have a custom object to track our activities.

    Every activity has a Stage with two values " Planning" and "Complete".

2) based on the stage value we want to color code the calendar ( Like "Green" for "Planning" and "Red" for "Complete" stage value).

3) Have this calendar as a component on their Home Page and ability to create the custom activity record from the calendar.

 

Any pointers would be of great help.

 

Thanks,

Sales4ce

I currently have a date field that displays a date 3 days from the date the form is opened. Here is the formula I used: TODAY() + 3

 

I would like to modify the formula to show a value of 3 business days instead of 3 days.  Can someone help?


Thanks in advance.

  • March 16, 2011
  • Like
  • 1