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
Kumar BittuKumar Bittu 

Attachment record count Issue into ContentVersion & contentDocument

Scenario/Issue -
    when I logged In with System Adminstrator profile and trying to attach file against existing case thenits shows one increment count to both ContentVersion & contentDocument table/Object.
    
    But when I tried to logged In with some other profile and tried to attach file against existing case then it showsfiles on case related list but It does not increment count to both ContentVersion & contentDocument table/Object and the more strange part is that If I copy the contentDocumentId from sfdc broswer and tried to run below query then It shows record -
  
SELECT Id FROM contentDocument where Id = 'XXXContentDocumentID'
    
    SELECT Id FROM ContentVersion where contentDocumentId = 'XXXContentDocumentID' 
    
    Short Summary - If we export the whole data of contentDocument then it does not show new record for attachment but if we run above query intosame table then it show records.

Please help on this - Reason behind why we are not getting newly attachment record into ContentVersion & contentDocument table/Object , if we do extract fullData.

Thanks
Kevin Mann 9Kevin Mann 9
Hello,
 Did you have a fix on this issue? Facing same issue but no response from anyone and couldnt find this topic troubleshooting in google. please help me out if you got solution.   


indigocard (https://www.indigocard.review/)
Kumar BittuKumar Bittu
I have found the solution of this issue - 
Spring 19' update there is a new setting in the "Setup -> Permission Sets -> (choose an existing or create a new one) -> App Permission -> Content -> Query All Files: Allows View All Data users to SOQL query all files in the org".

Refer below link-
https://salesforce.stackexchange.com/questions/2206/obtaining-all-contentdocument-records-using-soql