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
UtrivUtriv 

Google Maps Not Displayed After Converting Button to List View

I have a following code on the button (detail page button) that works fine from the record. But when I converted the button into the List Button with the same code, it stopped working. My purpose is to display multiple addresses on a map.

 

http://maps.google.com/maps?f=q&hl=en&q={!Establishment_Record__c.PremiseStreet__c}+{!Establishment_Record__c.PremiseCity__c}+{!Establishment_Record__c.PremiseState__c}+{!Establishment_Record__c.PremisePostalCode__c}&om=1

 

Please help.

 

Thank you in advance!

bob_buzzardbob_buzzard

What does the URL look like when you click the button?  I'm not sure what will be made of trying to use merge fields from a single object instance in a list view button, which works on a list of records.

UtrivUtriv

I am using the following code for my list view button. Anyone please help.

 

 

idArray = {!GETRECORDIDS($ObjectType.Establishment_Record__c)};

if (idArray[0] == null){
bContinue = false;
alert('Please select at least one row');
}

if (bContinue){

// Do things based upon the domain we are on
if (hostname.indexOf(".my.salesforce.com") != -1){
usePost = false;
if (idArray.length > 100){
bContinue = false;
alert('When using the My Domain feature in Salesforce, you are limited to mapping 100 records');
}
} else if (hostname.indexOf(".salesforce.com") != -1){
bContinue = true;
usePost = true;
server = hostname.substring(0,hostname.indexOf(".salesforce.com") );
} else if (hostname.indexOf(".force.com") != -1){
bContinue = true;
usePost = true;
server = hostname.substring(0,hostname.indexOf(".force.com") );
}

}

if (bContinue){

// Submit URL
f=document.createElement("form");
f.target = "_blank";

if (usePost){
f.action="http://maps.google.com";
f.method = "post";
} else {
f.action="http://maps.google.com";
f.method = "get";
}

f.submit();

}