0

Here I'm trying to display Report charts in visualforce page, but I'm getting an error:

[For the filter 1: Specify a valid filterable column because ParentId is invalid]

Actually, for Column names (API names), I looked in view page source, Workbench so many places online, but I couldn't find the right one.

I need you guys help to find out Column names for analytics:reportchart for the field Account.ParentId.

Look into below image and code for reference:

enter image description here


Code

<analytics:reportChart filter="[{column:'ParentId',operator:'equals',value:'001O00001IEpmW'}]" size="tiny" ReportId="00O9000009iEe" /> `
0

You can run below code in Anonymous Window.In JSON Output, you need to identify under detailColumns what is the exact label for your column. Based on that , you will apply the filter. For instance, if it says ParentId, you will mention parentId in column parameter.

Report reportRec = [SELECT Id FROM Report WHERE Id = '00ON0000000k7CyMAI'];

Reports.ReportResults reportResult = Reports.ReportManager.runReport(reportRec.Id, true);

system.debug('Test'+JSON.serialize(reportResult)); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.