To include Box file activity with Salesforce in the Box App Activity stream, you need some additional preparation in your enterprise. Details are below.
To test the Box for Salesforce integration in App Activity, you must upgrade your organization to the new Box for Salesforce v3.57. That is the version that supports App Activity. But keep in mind:
- If your enterprise has a customized deployment of the Box for Salesforce integration via Toolkit or SDK, you must also call a method in your custom instance to enable App Activity. See the Custom Toolkit/SDK Implementations section below for a link to the method to do this.
- This does not include app activity for previously-created Salesforce records. To enable this capability, your Salesforce admin must run an additional backfill script. See the Backfill section below for details.
Default Behavior
- After you install v3.57, each time someone clicks Create Folder to create a new folder, Box records an app activity on that new folder.
- Folders created previously do not have an app activity recorded.
- Folders created via any custom implementation using the Toolkit or the SDK also do not record any app activity. For these, follow the instructions toward the bottom of this page.
Backfill
Because previously-created folders do not have an app activity recorded out of the box, you can download and run a script to do the backfill. Run the script by uploading the code into your org. Then, from the Developer Console, execute the script as follows:
``` Database.executeBatch(new BackfillAppActivities(), 40); ```To avoid Salesforce governor limits, ensure the number of records to process per batch is less than 50. In the above example, the number of records is 40.
Custom Toolkit/SDK Implementations
When organizations have customized the behavior of their integration with Box, it's often the case that they are creating folders on their own using either the Toolkit or the SDK. To record an app activity in this scenario, Box provides a global Toolkit method called `enableAppActivity` that accepts a Box folder ID as a parameter and records an app activity.
The method signature for `enableAppActivity` looks like this:
Parameter |
Type |
Description |
folderId |
String |
The Box folder ID on which to enable app activities |
Here's how to call the method:
``` box.Toolkit toolkit = new box.Toolkit(); Boolean didEnableAppActivity = toolkit.enableAppActivity(<box folder id>); System.debug('did enable app activity?: ' + didEnableAppActivity); ```