Populating filter criteria and custom filter logic on Reports through URL

I have a custom report saved with no filter criteria. When calling it, I populate the criteria through the URL, so that the final URL looks something like:

https://na7.salesforce.com/00OA000000xxxZG?pc0=00NA0000xxxku0A&pc1=00NA00000xxxIed
&pn0=eq&pn1=ge&pv0=55979&pv1=8%2F20%2F2012

This works fine and fills in up to 10 filter criteria. However, I don’t seem to be able to use the bool_filter parameter to configure custom logic. From my understanding, the format should look like bool_filter=(1+OR+2)+AND+3. When this parameter is in the URL, I am directed to the Customize Report screen instead of displaying the report itself, and none of my criteria are reflected.

It seems possible to me that this might be a result of my report having no criteria in place initially, and maybe therefore “1 and 2” don’t have any reference for bool_filter. Anyone have any experience with this?

Answer

I figured it out. The bool_filter parameter can only refer to criteria rows that are saved in the Report. My “template” report was saved with no criteria, so that I could add them one at a time. So when bool_filter refers to 1 AND (2 OR 3), those filter rows don’t exist in the saved report, and it doesn’t know what to do.

Solution for me: I saved the report with 10 filter rows, each of which is Created Date not equal ''. Then I change what fields and values those filter rows are pointing to, and make sure the bool_filter parameter includes all integers 1 through 10. The final URL looks like this:
https://tapp0.salesforce.com/00OA0000004m4ZG?bool_filter=%28%281+AND+2%29+OR+%283+AND+4%29%29+AND+5+AND+6+AND+7+AND+8+AND+9+AND+10
&pc0=00NA0000009ku0A&pc1=00NA0000007jIed&pc2=00NA0000007jIed&pc3=00NA0000007jIed&pc4=00NA0000007jIed
&pn0=eq&pn1=ge&pn2=le&pn3=ge&pn4=le
&pv0=abc&pv1=8%2F21%2F2012&pv2=8%2F21%2F2012&pv3=8%2F21%2F2012&pv4=8%2F21%2F2012

Attribution
Source : Link , Question Author : Jeremy Nottingham , Answer Author : Jeremy Nottingham

Leave a Comment