Introduction
Box For SugarAI saves the files your team attaches in Sugar to your company's Box account, and lets you browse and download Box files without leaving Sugar.
- Automatic upload of files attached to Box records on Accounts, Contacts, Leads and Opportunities.
- Organized folders: one folder, a folder per module, or a folder per record.
- Box Files screen to browse, filter and download files from Box.
- Upload status and an Open in Box link on every record.
Version 2.0.0 · Sugar 14, 25 and 26 · By Techloyce
What's new in 2.0.0
Action required when upgrading from 1.x. After installing 2.0.0, open Admin > Box Settings and click Connect to Box once. Your Client ID, Client Secret and existing Box folder are kept. Then delete the file
custom/modules/box_Box/box/token.boxfrom your server: version 1.x stored the Box sign-in there in plain text, and 2.0.0 no longer uses it.
- Supports Sugar 14, 25 and 26.
- Connects with Box's API using secure OAuth 2.0. The Client Secret and Box tokens are stored encrypted, and sign-ins renew automatically.
- New Box Settings screen with a built-in setup guide, a connection status indicator, Connect, Disconnect and Test Connection.
- New Box Files screen (replaces Downloads): open sub-folders, filter, page through large folders, download or open in Box.
- Choose the upload folder name and whether uploads are organized by module or by record.
- A file with the same name as one already in the folder is saved as a new version of that file.
- Each Box record shows Open in Box and Box Upload Status.
- Regular users can browse only the Sugar upload folder in Box Files; administrators can browse the whole Box account.
Requirements
- SugarCRM 14, 25 or 26 (Professional, Enterprise or Ultimate), on premise.
- A Box account and permission to create an app in the Box Developer Console.
- Sugar must be reachable over https. Box does not accept http redirect addresses (except
localhost). - The Sugar server must be able to reach
api.box.com,upload.box.comandaccount.box.comover https.
Installation
- Log in to Sugar as an administrator.
- Go to Admin > Module Loader.
- Upload the Box For SugarAI package (
.zip) and click Install. Accept the license and wait for the installation to finish. - Go to Admin > Box License, enter your license key and click Validate.
Upgrading from 1.x: install 2.0.0 the same way, without uninstalling 1.x first. Your Box records stay in place.
Configuration
Step 1: Create a Box app
- Open the Box Developer Console. Sign in with the Box account the files should be stored in.
- Click Create Platform App, choose Custom App, then User Authentication (OAuth 2.0). Give the app a name, for example SugarCRM.
- Open the app's Configuration tab:
- Under OAuth 2.0 Credentials, copy the Client ID, and the Client Secret (click Fetch Client Secret).
- Under OAuth 2.0 Redirect URIs, click Add and paste the Redirect URI shown in Sugar's Box Settings (Step 2 below). It looks like
https://your-sugar-site/index.php?entryPoint=boxOAuth. - Under Application Scopes, tick Write all files and folders stored in Box.
- Click Save Changes at the top of the page.
Step 2: Connect Sugar
- In Sugar, go to Admin > Box Settings.
- Paste the Client ID and Client Secret and click Save.
- Click Connect to Box. Box asks you to sign in. Click Grant Access to Box, and Box sends you back to Box Settings.
- Click Test Connection. You should see Connected to Box as ... with the account name.

Step 3: Choose where files go
In Uploads on the Box Settings screen:
| Setting | What it does |
|---|---|
| Upload folder | Folder in the root of the Box account that receives the files. Created if it does not exist. Default: SugarCRM. |
| One folder | All files go to the upload folder. |
| By module | Files go to Upload folder / Accounts, / Contacts, / Leads or / Opportunities. |
| By record | Files go to a folder per related record, for example Upload folder / Accounts / Acme Inc. |
Click Save after changing these settings.
Using Box For SugarAI
Upload a file to Box
- Open an Account, Contact, Lead or Opportunity.
- In the Box subpanel, click + to create a Box record.
- Enter a name, choose the file and click Save.
The file is uploaded to Box right away. Open the Box record to see:
- Open in Box: link to the file in Box.
- Box Upload Status: where the file was saved, or why the upload failed.
To replace the file, edit the record, choose the new file and save. The new file is added in Box as a new version.
Browse and download Box files
Open the Box module menu and choose Box Files. Administrators can also open it from Admin > Box Files.
- Click a folder to open it, and use the breadcrumb at the top to go back.
- Type in Filter this folder to find a file by name.
- Click a file name or Download to download it, or Open in Box to view it in Box.

Regular users see the upload folder and its sub-folders. Administrators see the whole Box account.
Troubleshooting
| Message | What to do |
|---|---|
| redirect_uri_mismatch | The Redirect URI in the Box app is not exactly the one shown in Box Settings. Copy it again, add it in the Box Developer Console and click Save Changes. |
| invalid_client / "The client credentials are invalid" | The Client ID or Client Secret is wrong or belongs to another app. Paste both from the same app and Save. |
| Box only accepts https:// redirect URIs | Open Sugar over https. If Sugar is reached on another address (for example behind a proxy), enter it under Use a different redirect URI in Box Settings. |
| Upload failed with insufficient_scope or HTTP 403 | Tick Write all files and folders stored in Box in the Box app, Save Changes, then click Reconnect in Box Settings. |
| The Box connection has expired | Box sign-ins end after 60 days without use or when the app's secret changes. Click Reconnect in Box Settings. |
| The file is larger than 50 MB | Box accepts files up to 50 MB in one upload. Upload larger files in Box directly. |
| Box Settings opens the License page | Enter and validate your license key in Admin > Box License. |
The record always keeps its file in Sugar, even when the upload fails. Fix the cause, then save the record again to retry. Errors are also written to sugarcrm.log with the prefix [Box].
Uninstalling
Go to Admin > Module Loader, find Box and click Uninstall. Choose whether to keep or remove the Box records table. The Box settings and stored sign-in are removed from Sugar. Files already in Box are not touched. To stop Sugar's access completely, remove the app in the Box Developer Console.
Support
Techloyce · Use the Support tab above to open a case.