• salesforce@reserveadvisors.com
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi All, I was using the Find Nearby app in the appexchange. We use contracts extensively so I wanted to add a button to access the find nearby mapping. Effectively I retreive the contract Ids and then convert them into account Ids to pass to Find Nearby. I had been using what I believe to be SOQL or AJAX to accomplish this:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} 
var checked = {!GETRECORDIDS($ObjectType.Contract)}; 
var q = "Select Contract.AccountId From Contract Where Contract.Id In " + "('" + checked.toString().replace(/,/g, "','") + "')"; 
var result = sforce.connection.query(q); 
var records = result.getArray("records"); 
var accountids = ""; 
var first = true; 
for (var i=0; i < records.length; i++) { 
var record = records[i]; 
if (first) { 
first = false; 
} else { 
accountids = accountids + ","; 
} 
accountids = accountids + record.AccountId; 
} 
window.location= "/apex/FN__FindNearbymap?alids="+escape(accountids);

 

 

Unfortunately, my button does not work anymore. We use professional edition and we had temporary access to data loader. Due to this fact, we also had API access when we normally shouldn't. I programmed the button unknowingly ignoring the fact that we would lose API access eventually. I am unable to figure out a way to get the account Ids to return. Whatever Objecttype I use, it returns the contract Ids.

Hello all! We have Map Nearby currently installed and it works wonderfully. Many of our list views are in the contracts however. I would like to have a map contracts button on a contract list that will map the accounts associated with the contracts using the map nearby app.

 

My current javascript button is as follows:

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
var selecteditems={!GETRECORDIDS($ObjectType.Account)}; 
window.location= "/apex/FN__FindNearbymap?alids="+selecteditems;

 

However, the getrecordids returns the contract ids instead of the account id (i.e. I want it to return Contract.AccountId). No matter what I put, be it Contract.Name or an ObjectType, it always returns the ids associated with the selected contracts. If I can just get it to return the account ids instead, I believe it will work.

 

Thanks for the help!

Hi All, I was using the Find Nearby app in the appexchange. We use contracts extensively so I wanted to add a button to access the find nearby mapping. Effectively I retreive the contract Ids and then convert them into account Ids to pass to Find Nearby. I had been using what I believe to be SOQL or AJAX to accomplish this:

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} 
var checked = {!GETRECORDIDS($ObjectType.Contract)}; 
var q = "Select Contract.AccountId From Contract Where Contract.Id In " + "('" + checked.toString().replace(/,/g, "','") + "')"; 
var result = sforce.connection.query(q); 
var records = result.getArray("records"); 
var accountids = ""; 
var first = true; 
for (var i=0; i < records.length; i++) { 
var record = records[i]; 
if (first) { 
first = false; 
} else { 
accountids = accountids + ","; 
} 
accountids = accountids + record.AccountId; 
} 
window.location= "/apex/FN__FindNearbymap?alids="+escape(accountids);

 

 

Unfortunately, my button does not work anymore. We use professional edition and we had temporary access to data loader. Due to this fact, we also had API access when we normally shouldn't. I programmed the button unknowingly ignoring the fact that we would lose API access eventually. I am unable to figure out a way to get the account Ids to return. Whatever Objecttype I use, it returns the contract Ids.

I remember this working previously (or some incarnation thereof), but it's not working now when I'd actually like to use it. Does anyone know what the new method for displaying a dynamic sobject's label is without resorting to a describe call in a controller or extension?

I am working on a visualforce component that displays fields of arbitrary sobject.

Now I need a way to get some field describe information for a given sobject name and field name.

As I cannot pass Describe objects to the page I would have to create my own schema class to pass this Not nice!

 

The I read one could use the $ObjectType global variable in pages and that this works with dynamic binding. But it seems only to work with fields not objects...

 

WORKS:                         {!$ObjectType.Account.Fields[fieldName].Label

 

DOES NOT WORK:        {!$ObjectType[objectName}.Fields[fieldName].Label

 

Why and in case this does not work what else should I do to get those information without an extra custom class?

 

Thanks in advance

 

Robert