---
schema_version: "1"
id: 8948143b1ab029642862c3f038d2a39f38c28b0c7d820fc4bebbe0b390a871dd
title: Bulk Actions Example
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_dashboards_configure_bulk_actions_example.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_dashboards_configure_bulk_actions_example.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e700e03e0a6659422fa7ef2414c531ae060cf616286808f2ccd3b8e10a7ce3cf
description: You want to add the “Create Opportunities” option in a table widget’s action menu. This action must create an opportunity for each account shown in a table widget.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Bulk Actions Example

You want to add the “Create Opportunities” option in a table widget’s action menu. This action must create an opportunity for each account shown in a table widget.

![The action menu for the table widget as a "Create Opportunities" option.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_dashboards_bulk_action_menu.png)

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

Note This widget-level action menu is different from the record-level action menu that you can access from a record.

To keep the user informed of what is happening, the action must also display a Visualforce page that shows the progress of the following tasks.

- The Visualforce page retrieves a list of accounts from the SAQL query used to populate the table widget. If the table widget’s results were previously filtered because of selections in other dashboard widgets, only the filtered records are returned.
    
    ![The Visualforce page says that it's querying accounts.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_dashboards_bulk_action_results_querying_accounts.png)
- The Visualforce page creates an opportunity for each retrieved account.
    
    ![The Visualforce page says that it's creating opportunities.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_dashboards_bulk_action_results_creating_opps.png)
- The Visualforce page shows the opportunity created for each account.
    
    ![The Visualforce page lists the opportunity created for each account.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_dashboards_bulk_action_results_created_opps.png)

To implement this bulk action, perform the following tasks.

1. **[Define Action Behavior with Apex Controller Class and Methods](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboards_configure_bulk_actions_example_apex_class.htm&release=264.0.0&type=5)**  
    Define an Apex controller class and methods that generate a list of accounts shown in the table widget, create an opportunity for each account, and return the progress of each task.
2. **[Create a Visualforce Page That Executes the Action](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboards_configure_bulk_actions_example_visualforce_page.htm&release=264.0.0&type=5)**  
    The Visualforce page calls the methods defined in the Apex controller class to invoke the action and provide a status on the tasks.
3. **[Assign Bulk Action to Table Widget](https://help.salesforce.com/s/articleView?id=analytics.bi_dashboards_configure_bulk_actions_example_widget_properties.htm&release=264.0.0&type=5)**  
    Configure the table widget properties to expose the bulk action defined in the Visualforce page.