+ Start a Discussion
devNut!devNut! 

Accessing data form a VIEW or REPORT

Hello,
Once a View or Report is created.  Is there a way to get at the data it contains?

E.g.
- Create a new view on accounts
- Click a button (preferably on the views page) to do something with the account records in the view

Thanks.
jwelljwell
Don't know if this is what your asking but I use list buttons to work with records in our list views.

Here is an example of a custom object list view that will update a field in each selected record in the list and export the selected items to an excel report.


Create a new button on the object
Behavior = Execute JavaScript
Display Type = List Button

OnClick JavaScript:
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
var records = {!GETRECORDIDS($ObjectType.MRF_Item__c)};
var newRecords = [];
if (records[0] == null)
{
alert("Please select at least one item")
}
else
{
for (var n in records) {
var c = new sforce.SObject("MRF_Item__c");
c.id = records[n];
c.Sub_status__c = "Waiting for Supplier Reply";
newRecords.push(c);

}
result = sforce.connection.update(newRecords);

self.location='https://na1.salesforce.com/00O30000001e1U6?pv0='+records+'&excel=1'

}

-------
Change the MRF_Item__c to the object that is in your list view.
c.Sub_stauts__c = is my custom field that is being updated so remove or modify as needed.

HTH

James
devNut!devNut!
Yes,
Thanks very much.

After much searching I did find that .

Too bad you cant use a visualforce page instead of an s-control.
jwelljwell
I don't see why you couldn't however thats currently beyond my scope. Maybe someone could provide another solution for this.
devNut!devNut!
Salesforce config currently doesn't allow it.

Thanks for your input.