You need to sign in to do that
Don't have an account?
Custom Related Content under Account RelatedLists
I have the below piece of Code to display Related Contents of an Account record on a visualforce page as a related List in attempt to replace the Standard Related Content related list and hide the action links on it, but it seems that I can't get the relationship query right on ContentDocumentLink!
Is there any other way to do this? Help Please…
acc = (Account)controller.getRecord();
List<Account> account = [select Id,Name from Account where Id=:acc.Id];
ContentLinks = [Select Id, SystemModstamp, ShareType, LinkedEntityId, IsDeleted, ContentDocumentId From ContentDocumentLink where LinkedEntityId=:acc.Id];
//ContentLinks comes up empty as the relationship (LinkedEntityId=:acc.Id) is not working
if(ContentLinks.size() > 0){
for(ContentDocumentLink cdl : ContentLinks) dIds.add(cdl.ContentDocumentId);
}
contentVers = [Select Id, Title, ContentSize, ContentDocumentId, LastModifiedDate,CreatedDate From ContentVersion where AND ContentDocumentId IN:dIds];
Hi Plz make sure Acc.Id has a value by placing a debug statement.
Also, try changing your API version from 26 to 25.
I did all that, acc.Id has value. I am not sure if LinkedEntityId is used for relation with Account?