5

I am developing a package based on salesforce DX which requires files (images) to be installed. I want to put them into a special library so they do not get mixed up with other content.

When I log into one of the scratch orgs (developer or enterprise edition), I am NOT able to successfully create a library on the Files tab with the "New Library". The button works and the dialog comes up so I can enter name, description, an icon and can hit "save".

Even though there is no error message but the green banner indicating that the new library has been created, the newly create library is NOT visible in LEX at all.

After some checking it turns out that in classic I can see the "library" but I get many confusing informations:

  1. It's only available on the "Manage Library : Select Library" pop-up on the right hand side but

  2. the library is not visible in the "My Libraries" section. and

  3. When I select the new library by the pop-up I get the message "You are not a library member. Viewing recent activity requires library membership." in the "Last activity" area on the libraries management page even though I am listed in the members section

I've checked/enabled all permissions with respect to "saleforce CRM content" but cannot get it to work.

Please advise on how to get libraries/files working corrently on sfdx scratch orgs.

Thx.

3 Answers 3

3

I'm currently running into the same issue, but I found a workaround to create an accessible Library via the Classic UI.

  1. Switch to Classic Experience
  2. Create a new User Group (add yourself)
  3. Create a new Library -> Save and Add Members -> add your User Group
3

For solving this problem you need to assign a role for your user.

5
  • Will any role work?
    – nbrown
    Dec 1, 2020 at 13:38
  • Do you have any documentation you could point to which indicates this fix would be the appropriate action in this case?
    – Adrian Larson
    Dec 1, 2020 at 16:44
  • Actually I don't see any documentation according to this point, but any role will solve the problem.
    – Oleg M
    Dec 13, 2020 at 10:45
  • Spent a few days bashing my head against this issue with no luck, thank you so much. Definitely another one of those wonderful SF problems with a solution that doesn't make sense. Feb 1, 2021 at 18:20
  • I don't find any documentation for that as well, but if you create a new user with any role it will work - there is a bug with most scratch orgs where the User User default role is SVP Customer Experience which can't be removed and changed and creation of Libraries won't work with. SF don't have an SLA for fixing this bug...
    – GoldenAxe
    Jun 1, 2021 at 10:14
1

Ive come across this encountring exactly the same issue. It is a real pain.

Been trying to get around it by inserting the content workspace record via anon apex and also querying it back without any joy, it is the same as what ones sees in lex in that I can insert the ContentWorkspace, right after doing that I have the id back in the apex. But I cant query it with SOQL.

ContentWorkspace myCW = new ContentWorkspace( name ='Apex Test6');
System.debug('myCW BEFORE INSERT = ' + myCW);
insert myCW;
System.debug('myCW AFTER INSERT= ' + myCW); // This does return an Id

But a query like:

SELECT Id, Name, Description, WorkspaceType,RootContentFolderId, DeveloperName FROM ContentWorkspace

Does not return it (but does return those made via the classic workaround mentioned above).

I dont know if it significant but did notice that the ones made in classic have amysterious RootContentFolderId populated but that field is not writeable via apex.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .