Embed Child Box Folder into Child Record in Salesforce
Hi,
I am using the Box Developer Toolkit.
I have the Box widget embedded in Salesforce Account records, and it opens to the Box folder for that Account.
I also have a folder for each child Case record under the Account folder in Box.
I would like to embed the Box Widget on the Case, and have it open up to that Case record.
I keep getting the error when I try to associate the Box folder to the Case Id
Unable to create root folder Cases- Details: A folder with the name Cases already exists.
But i am not trying to create a root folder, just associate a Case in Salesforce with a folder in Box.
Any ideas? Is it possible to do this?
Thank you
-
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
-
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
-
Thanks for the context , that helps.
After some digging, I would say there might be a few possible ways to resolve:
- 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.
- 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
-
,
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 -
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.
-
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.
Please sign in to leave a comment.
Comments
6 comments