+ Start a Discussion

How to Know in Apex Report is related to which object

i am trying to access the Report objects in apex but getting limited fields my apex source code is

public Class MyController{
public List<Report> getReports(){

List<Report> rep1 = new List<Report>();
rep1=[Select Id,Developername,Description,Name,OwnerId from Report];

return rep1;



but i want to get the value of the sObject type to which it is related to for example 1.i click on new Report 2.then select Opportunities 3.then click create

how to get this opportunity object and how to get filters applied to reports please explain it.

Unfortunately, you won't be able to get that information. According to Salesforce's doc that information isn't available via their API. Check out all the fields available here: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_report.htm