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
bharath kumar 52bharath kumar 52 

Not able to fetch report id through select query but getting it in anonymous apex

Hi All,

I am working on a requirement where i am using report ids i.e report ids are hardcoded.
<analytics:reportChart reportId="00O28000006Uvr3" size="small" ></analytics:reportChart>
I need to get remove this hardcoding and get it from select query. How can i accomplish this?

Thanks,
Bharath
 
Andrew EchevarriaAndrew Echevarria
In your controller, you can create a getter function:
public getDynamicId(){
   // SOQL, all the operations you need to get the id
   return dynamidId;
}

Then, in your reportChart you would set it to the getter:
<analytics:reportChart reportId="{!DynamicId}" size="small" ></analytics:reportChart>