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
bond006bond006 

Querying reports from folders

hey guys, I have written a code using objects called "Folders" & "Reports" in such a way that I get the Id from Folders object and by using that I am getting reports from Reports Object. But I was supposed to show the reports which are accesible by the user who logged in. There is no option which shows whether the current user has access to reports or not?
My code: 
for(Folder tmp:[SELECT AccessType,Id,IsReadonly,Name,DeveloperName,Type FROM Folder WHERE Type = 'Report']){
     
      if(tmp.DeveloperName=='Referrals'){
        refId = tmp.Id;
        
        }
}
refrportlst = report(refId);
List<Report> tempreport = [SELECT Name, Id,OwnerId, description, DeveloperName, SystemModstamp FROM report where OwnerId=:refId order by name];

Note: now I need to show the reports which the current user can access to!

Please let me knowis there a way to do it.

PrasanntaPrasannta (Salesforce Developers) 
Hi,

Please refer to the link below to show only records that relate to the current user-
https://www.quickbase.com/help/default.html#curuser_views.html

Hope this helps.