You need to sign in to do that
Don't have an account?
Patrick Nylen
Chart embedded on Visualforce page opens in edit mode
Hello,
I'm using the reportChart component to embed a chart on a Visualforce page. When clicked, though, the report opens in edit mode and, while the filters are visible in the URL, clicking Run Report then shows the unfiltered report.
See my example below. The issue seems to be the "THIS YEAR" value in the second filter. When replaced with an actualy date (e.g. "2016-01-01") everything works fine. Is there another way to reference "this year"?
<analytics:reportChart reportId="xxxxxxxxxxxxxx" showRefreshButton="false" size="medium" cacheResults="false" filter="[{column:'Custom_Field__c', operator:'equals', value:'Value1,Value2,Value3'},{column:'Custom_Date_Field__c', operator:'equals', value:'THIS YEAR'}]"></analytics:reportChart>
I'm using the reportChart component to embed a chart on a Visualforce page. When clicked, though, the report opens in edit mode and, while the filters are visible in the URL, clicking Run Report then shows the unfiltered report.
See my example below. The issue seems to be the "THIS YEAR" value in the second filter. When replaced with an actualy date (e.g. "2016-01-01") everything works fine. Is there another way to reference "this year"?
<analytics:reportChart reportId="xxxxxxxxxxxxxx" showRefreshButton="false" size="medium" cacheResults="false" filter="[{column:'Custom_Field__c', operator:'equals', value:'Value1,Value2,Value3'},{column:'Custom_Date_Field__c', operator:'equals', value:'THIS YEAR'}]"></analytics:reportChart>
Did you test THIS_YEAR ?
{column:'Custom_Date_Field__c', operator:'equals', value:'THIS_YEAR'}
I have tested the following filter and it is correct for CREATED_DATE:
filter="[{column:'CREATED_DATE', operator:'equals', value:'THIS_YEAR'}]"
Regards
The ugly workaround: using 2 filters to dynamically constrain the results to the current year:
{column:'Custom_Date_Field__c', operator:'greaterThan', value:'{!YEAR(TODAY())-1}-12-31}'},
{column:'Custom_Date_Field__c', operator:'lessThan', value:'{!YEAR(TODAY())+1}-01-01}'}
That should work. This test is correct.
Regards
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_analytics_reportChart.htm
That works but the values appear in the results of the describe command.
Regards