To add a button to the detail page of the tab associated with the object on which the report is to run:
- From Setup, click Create | Objects |
YourObject
.
- Scroll to the Buttons, Links and Actions.
- Click New Button or Link.
- Complete the Label and Name fields.
- Click Detail Page Button.
- Select Display in new window from the Behavior drop-down list.
- Depending on what your users will do with the report, do one or both of the following:
- Click Save.
- Add the Detail Page Button you created to the page layout of the object.
- If you haven't already done so, add the Output Histories related list to the page layout of the object.
To add a button to the list view of the tab associated with the object on which the report is to run:
- From Setup, click Create | Objects |
YourObject
.
- Scroll to the Buttons, Links, and Actions section.
- Click New Button or Link.
- Complete the Label and Name fields.
- Click List Button.
- Ensure that the Display Checkboxes (for Multi-Record Selection) checkbox is selected.
- Paste the following in the large box beneath the Select Field Type drop-down list:
var tmp='';
var arr = {!GETRECORDIDS($ObjectType.YourObjectAPI
)};
for(var i=0;i<arr.length;i++)
{
tmp+=arr[i]+',';
}
var url = '/apex/ob1__OutputListViewManager?&class=NameofTemplateClass
&idset=' + tmp;
window.open(url, '_blank', 'height=600,location=no,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=1');
var arr = {!GETRECORDIDS($ObjectType.YourObjectAPI
)};
for(var i=0;i<arr.length;i++)
{
tmp+=arr[i]+',';
}
var url = '/apex/ob1__OutputListViewManager?class=NameofTemplateClass
&idset=' + tmp;
self.location=url;
Where:YourObjectAPI
is the API name of the object on which you are creating the report.NameofTemplateClass
is the is the name of the template class to which the report relates.
- Add the List Button you created to the List View in the Search Layouts section of the object.
- If you have not already done so, add the Output Histories related list to the page layout on the object on which the report is to run.
Related Content