I have a requirement to have a custom button on Account detail page. A click on that should show all available records for logged in User of a custom object Approved_Documents_vod__c. This object has no direct relation with Account. Please let me know if that is possible without any visualforce page.

1 Answer 1


Please create a Custom button on the Object where you want to show all records and below is the Code for the custom button:


// Quering the database and Example Query and you can modify it as per your requirement

var result = sforce.connection.query("Select ID From Opportunity"); 

// Getting all records from the query to the array 
var records = result.getArray("records"); 


Note: You don't have to write any visualforce page and there is no relation between the objects.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .