function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Phuc Nguyen 18Phuc Nguyen 18 

File Visibility always set to All users

I am copying contentdocumentlink to another object
cdl.ShareType = 'I';
cdl.Visibility = 'InternalUsers';

But the visibilty when I look at the fileis 'All Users', why is that?  I need it to be private.

Best Answer chosen by Phuc Nguyen 18
Foram Rana RForam Rana R
  • When there are no communities defined in the org, a  File shared with a record will have default visibility set to AllUsers.
  • When there is at least one community defined in the org, a File shared with a record will have its visibility set to InternalUsers, by default.

Foram Rana