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

Embed Child Box Folder into Child Record in Salesforce

New post

Comments

6 comments

  • jcleblanc

    Hi ,

     

    A few questions for you on this one:

    • When you say that you're associating the folder ID with the case, are you collaborating the service account / app in on the folder owned by the account holder (presuming that's another user)? 
    • For the Box widget, is that the Box embed widget, Box UI Elements, Box View application, or something else?

    Typically the reason that this error occurs is if you're trying to use a duplicate folder name in an account where the same folder exists, so if you're trying to collaborate a user in on a root folder and they have one with the same name that error will occur. If that's not the case we can dig in further based on the questions above.

     

    Thanks,

    Jon

    0
    Comment actions Permalink
  • megal

    Jon, 

    Thank you for the quick response!

     

    The Service Account owns the Account and Case folder, and I am using the Box Embed Widget. 

     

    My Box folder structure is salesforce (root folder) -> Accounts -> Account1234567 -> Case0012345

    There is no Cases folder under Account1234567, but there is one under salesforce(root folder). 

     

    I am calling createFolderAssociation(Salesforce record Id for Case 0012345, Box folder id for Case0012345), and this is where I am getting an error. Also, I don't know if it matters, but Box folder Account1234567 is already associated to the Account 1234567 in Salesforce.

     

    Thank you, 

    Megan

     
    0
    Comment actions Permalink
  • jcleblanc

    Thanks for the context , that helps.

     

    After some digging, I would say there might be a few possible ways to resolve:

    1. That method will ensure that only one association can be made between a Box Folder and a Salesforce record. I'm unsure if that error would present if a duplicate association is attempted, but that may be one reason.
    2. If not, this might have to do with an association being made at a higher folder level and then another being made at a child folder under that. If you attempt an association on another root level folder does that problem persist?

    If the problem continues it may also be worth filing a support ticket to allow them to dig in further.

     

    - Jon

    0
    Comment actions Permalink
  • megal

     

    Thanks for the help and sorry for the delayed response. The error does happen on any time I try to relate a child Salesforce record with a child Box folder, but I was able to find a workaround.

     

    I get the embed URL for the parent Account folder (which works fine), then I do a String replace on the returned URL and replace the Account Box Folder Id with the Case Box Folder Id, and it displays the correct folder.

     

    Thanks, 
    Megan

     
    0
    Comment actions Permalink
  • tom_tam

     

     

    Can you expand on your workaround please?

    Are you using the Salesforce Developer Toolkit?

    https://developer.box.com/en/guides/tooling/salesforce-toolkit/methods/

     

    My use case is creating a new page in our Visualforce community for partner users. Partner users are contacts who belong to a partner account record. Partner user contacts cannot view the account record they belong to. So I want to pass the partner user's accoundid to the VF page, then display contents of the Box folder that are related to their account record. 

     

    0
    Comment actions Permalink
  • megal

     

     

    I am using the Developer Toolkit along with the Box SDK for Salesforce.

     

    I haven't worked with Partner accounts before so I'm not sure if there is security that would prevent the user from seeing the files, my users have access to all the folders involved.

     

    But I used the BoxToolkit to get the URL for the folder 

    PageReference acctURLPage boxToolkit.getFolderUrl(AccountId, false);
     
     Then a string replace to switch the folder Id in the URL with a different folder id.
    String boxURL = 
    String.valueOf(acctURLPage.getURL()).replace(originalFolderId, newFolderId);
     
    Then displayed the String in an iFrame on the VF Page
    <apex:iframe src="{!boxURL}" scrolling="true" id="theIframe"/> 
     
    Hope this helps.
     
     
     
     
     
     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.