Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

SalesForce dev toolkit - How to associate record with Box Folder

New post

Comments

5 comments

  • rocks

    Hi Koby,

     

    Thanks for posting this question.  Can you please provide a little bit more information about where the folder actually gets created at in Box / and desired folder structure?

     

    The default integration automatically creates a folder with the name of the Account ("ACME") as a sub folder within the Salesforce-Org --> Accounts directory:

     

    Salesforce Folder Tree.png

     

    "But for some reason the association of the SFDC folder and the BOX folder is not happening althoug our code is copy/paste of the code provided by BOX."

    0
    Comment actions Permalink
  • kobymiz

     

    Hi,

    Thanks for the reply. You stated in your answer that the default integration automatically creates a folder for the account with the name of the account.

     

    This is true but it is not automatic - You have to go into the account page and click the "Create account folder" button in the Box Section.

     

    I am trying to create the folder automatically when the account is created. For that I wrote an Apex Trigger that fires after the account has been created and I am calling to the code that creates the BOX folder and associate it with the account. The solution was taken from the follwoing article: https://community.box.com/t5/Integrations/Box-For-Salesforce-Developer-Toolkit/ta-p/689#code 

     

    Koby

    0
    Comment actions Permalink
  • JoshuaDeYoung

    Over a year later.. Koby did you ever get an answer or any help with this? 

     

    If you did I'm dealing with a similar issue and would love to know what you wound up doing. 

     

    Thank you

    0
    Comment actions Permalink
  • cary

    Hey Joshua,

     

    I'll try taking a stab here. There's a couple avenues you can go down to automatically create folder for accounts/opportunities upon visiting that record. 

     

    1.) This should be native to the integration but if you were to navigate to Box Settings Tab inside your Salesforce account, you should 

    come across an option called 'Auto-Collab', make sure that is enabled. This allows the person visiting the Salesforce record to automatically

    get collaborated into the record and create a Box folder in their account. 

     

    2.) If you want to fire this creation from a trigger, what you could do is set up a trigger on opportunity/account creation and have that trigger

    pass in a list of Salesforce record Id's you would want to create Box folders for. You would then use the method 'createFolderforRecordId'

    from the Box for Salesforce Developer Toolkit to create the Box folder for the Salesforce Record. Seen here: 

    https://developer.box.com/v2.0/docs/box-for-salesforce-developer-toolkit

     

    I believe there is an example on how to use it as well in the code block towards the bottom of the page. 

     

    Hope this helps! 

    0
    Comment actions Permalink
  • tom_tam

     The sample code covers creating a single folder. How does the toolkit handle mass creations? So if an after insert trigger in Salesforce executes, are there any accommodations to be made for iterating over each account that gets inserted and using the createFolderForRecordId method?

    0
    Comment actions Permalink

Please sign in to leave a comment.