You need to sign in to do that
Don't have an account?
Radha Rathinavel 1
update visiblity column in ContentDocument link
Hi
I tried to update the visibility column in content documnet link object. It throws error.
Error:
System.SObjectException: Field is not writeable: ContentDocumentLink.Visibility
My Code:
List<ContentDocumentLink> cdl1 = new List<ContentDocumentLink>();
List<ContentDocumentLink> cdl =
[select Id, Visibility, contentdocumentid
from contentdocumentlink where
contentdocumentid = '069350000009lvHAAQ'
];
for(ContentDocumentLink cd : cdl)
{
cd.Visibility = 'AllUsers';
cdl1.add(cd);
}
Update cdl1;
I tried to update the visibility column in content documnet link object. It throws error.
Error:
System.SObjectException: Field is not writeable: ContentDocumentLink.Visibility
My Code:
List<ContentDocumentLink> cdl1 = new List<ContentDocumentLink>();
List<ContentDocumentLink> cdl =
[select Id, Visibility, contentdocumentid
from contentdocumentlink where
contentdocumentid = '069350000009lvHAAQ'
];
for(ContentDocumentLink cd : cdl)
{
cd.Visibility = 'AllUsers';
cdl1.add(cd);
}
Update cdl1;