Code Monkey home page Code Monkey logo

box-for-salesforce-blueprints's Introduction

Box for Salesforce Blueprints

Box for Salesforce Blueprints is a collection of examples designed to work with the Box for Salesforce managed package. These samples are designed to be used for demonstration, development, and test purposes.

Pre-Requisites

  1. Clone this github repo.

  2. Setup your Salesforce DX environment: https://trailhead.salesforce.com/en/content/learn/projects/quick-start-salesforce-dx/set-up-your-salesforce-dx-environment

  3. Setup VS Code: https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/set-up-visual-studio-code

  4. Enable Dev Hub in Salesforce.

  5. Install and Configure the Box for Salesforce Managed Package: https://community.box.com/t5/How-to-Guides-for-Integrations/Installing-and-Configuring-Box-For-Salesforce/ta-p/180

    Note: Dont forget to add the Box VisualForce components to each of the record type layouts.

  6. Install the Box Salesforce SDK Unmanaged Package:

  7. Open the source from this repo in VS Code.

  8. In VS Code, use the cmd+shift+p shortcut and select SFDX: Authorize Org

  9. Confirm you've successfully authorized your org by listing orgs and their associated status:

sfdx force:org:list
  1. List the installed packaged for your org:
sfdx force:package:installed:list -u <[email protected]>
  1. Locate the Box for Salesforce package and copy the PACKAGE ID and VERSION into a new dependencies json element of the sfdx-project.json located at the root project directory.

It should looks something like this:

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "45.0",
  "dependencies": [
    { 
      "package" : "033700000004yvWAAQ",
      "versionNumber": "3.56.0.1"
    },
    { 
      "package" : "0334P000000kKiUQAU",
      "versionNumber": "1.0.0.1"
    }
  ]
}
  1. Deploy you project source to either you scratch org or developer org in the next section.

Deploy to your Org

Push to Scratch Org:

sfdx force:source:push

Deploy to Developer/Production Org:

sfdx force:source:deploy -p force-app -u [email protected]

Box JWT Connection Configuration

  1. Open the newly deployed Box Platform Settings tab found in the App Launcher:

Box Platform Settings tab

  1. Click the New Connectiom button to add a new JWT connection.

New Connection

  1. Follow the instructions in the New Connection wizard:

Pre-Requisites

  1. Upload the newly created sfdx_box_config.json

Configure Part 1

Configure Part 2

  1. Provide a new JWT Connection Name, review the values that were parsed from the JSON file, then click Next.

Review

  1. Confirm that the Box JWT Connection Test was successful and the Box Service Account Name, Login, and IDs were returned. Finally click Save.

Connection Test

  1. Confirm the save worked and the new connection is populated in the data table.

New Connection Created

  1. Enable Communities, create a new community, and in the Community App Builder add the Box Content Explorer component for a record detail page.

    Note: The Box Content Explorer will only render folders for records in which a folder has already been created.

Add Box Content Explorer

Preview Box Content Explorer

  1. You will most certainly receive CORS errors in the browser console. Go to your application configuration in the Box Developer console and add the appropriate domains found in the browser console error.

Preview Box Content Explorer

Description of Customizations

  1. CSP Trusted Sites

    Why manually configure CSP Trusted Sites for Box when you can automate it?

  2. Box Platform Connection components

  3. Box JWT Connection and Token Exchange Logic

  4. Standard Object Triggers and Corresponding Apex Handlers

  5. Box UI Elements

  6. Large Batch Processing with Salesforce Platform Events

Platform Events Example

  1. Private Key Conversion Script

Disclaimer

This project is a collection open source examples and should not be treated as an officially supported product. Use at your own risk. If you encounter any problems, please log an issue.

License

The MIT License (MIT)

Copyright (c) 2019 Kyle Adams

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

box-for-salesforce-blueprints's People

Contributors

kylefernandadams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

box-for-salesforce-blueprints's Issues

Minor updates to parse_box_config.py

Hi Kyle, I am using these blueprints, really helpful. Thank you. Please note the below changes I needed to make in parse_box_config.py


When using Popen function in def "convertCryptoKey" it errors out "file not found".
Fix

  1. add shell=True
  2. provide full path for openssl.exe and tempKey.txt

In def "modifyPkString", first decode the newKey - otherwise errors out "a bytes like object is required, not str"
Fix
3. withoutFirstLine = newKey.decode().split('\n')[1:]

Salesforce/Box Integration Issue: unauthorized_client, This app is not authorized by the enterprise admin

Inspite of accurately following the instructions provided in the https://github.com/kylefernandadams/box-for-salesforce-blueprints we are still encountering the issue when we Setup Box Platform Settings, after uploading the sfdc_box_config.json

{"error":"unauthorized_client","error_description":"This app is not authorized by the enterprise admin"}

image

Kindly advise what we are missing. Just FYI the same setup between Salesforce Sandbox and Box Sandbox environment worked fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.