Box and Salesforce Integration

New post



  • SowmyaM

    Hey ,

    I am trying to upload files from Salesforce to Box  using BOX SDK.
    Ca any one help me how to use BOX SDK for uploading files? It is quite urgent for us.Like which method to call , what is file ID which has to be passed..I am bit confused.


    Thanks in Advance !

    Comment actions Permalink
  • nsweeney

    Hi.  I'm really struggling with getting our files from Box into Salesforce.  Does anyone have any idea how to do this?  I'm not a coder yet Box seems to think I understand, even though I repeatedly tell them otherwise, what they mean by this:




    Salesforce record Id that is being associated with a box folder.



    Box folder Id being associated with a Salesforce record.


    • boxFRUPc object - The FRUP object returned will be null if there was an error (check mostRecentError). Upon calling the commitChanges method, this FRUP entry will be inserted into the database.
    • This method ensures consistency with other folder associations by not allowing the same folder to be associated with multiple records or vice versa.

    Should this code be inserted somewhere that will help with my problem?


    Thanks for any assistance you may be able to provide!

    Comment actions Permalink
  • rsweeney

    Hey , the Box for Salesforce integration allows you to connect your Salesforce records to Box folders by creating new folders in Box like so:

    You don't have to write any code yourself if this is all you are looking to do. 


    However, if you are looking to connect Salesforce records to folders that already exist in Box then you have two approaches:

    • Use the Box for Salesforce integration the way it is and move your pre-existing content into the new folders that Box for Salesforce creates.  As an example, say you currently have a folder called Opportunity1Stuff with content in it.  You also have an Salesforce record called Opportunity1.  As described in the above link, you could use Box for Salesforce to select Create Folder to create a new folder called Opportunity1 which is then linked to the Salesforce record Opportunity1Then you could manually move the content in the Opportunity1Stuff folder to the Opportunity1 folder which would not require coding.
    • OR you could use the createFolderAssociation method you mentioned.  To actually run this method you'll need to do the following:
      • Log into your Salesforce account
      • In SF Lightning, click the gear icon at the top right.  In SF Classic, click your username.
      • From the drop down list, select Developer Console  (I think you need to be a System Admin in Salesforce to access this)
      • In the new window that pops up, select Debug from the menu at the top left
      • From the drop down list, select Open Execute Anonymous Window
      • In this new window you would enter the following code and hit Execute
        • box.Toolkit boxToolkit = new box.Toolkit();
          boxToolkit.createFolderAssociation(, );

    This createFolderAssociation process would need to be followed for each SF record you want to associate with a Box folder.  If you want to automate the process of linking many SF records to their respective folders then you would need to write a script to do so either leveraging internal development resources or getting in touch with a 3rd party that could assist with the development process.  We also have a Box Consulting Team that might be able to help with this so let me know if that interests you.

    Comment actions Permalink
  • nsweeney

    Thank you for your message.  We have decided to not do the Box integration with Salesforce because of the requirement to continually have to log in and out of Box Drive to see files that have been moved.

    Comment actions Permalink
  • sfcrmguy

    You can create a webhook in Box that calls a REST API in Salesforce to capture file movement, renames, etc...  so that it happens in real time, rather than periodically looking for changes.

    Comment actions Permalink

Please sign in to leave a comment.