Background
(This question is a more specified version of ytiq's question File "Customer Access" Permissions)
Salesforce Lightning now requires that a file have the "Customer Access" toggle set to "Enabled" for a Customer Community user to view it (image below for reference, link to documentation here). As far as I have been able to determine, there is no way to set "Customer Access" to default to enabled via Salesforce Setup.
This is creating a problem for our business process, as internal users must now manually toggle this for every file that we share with Customer Community users, greatly amplifying busy-work and room for user error.
Need
I need to determine how to access the "Customer Access" feature/component/field/object, or however it is stored, so that I can build code to set it to automatically share with Customer Community users.
Ask
Where is the "Customer Access" element of a File located in Salesforce (what object, field, metadata, etc.).
Best Answer
It's on the
ContentDocumentLink
underVisibility
as shown hereWhen you select
CustomerAccess
asEnabled
, you're essentially setting thisVisibility
field toAllUsers
. You can test this yourself in a sandbox by uploading a file on a given record and querying the ContentDocumentLink with the below queryYou will see that it's first shared with
InternalUsers
with theCustomer Access
disabled and then changes toAllUsers
when it is enabled.