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
YRYR 

Running report from URL with dynamic advanced filter

Hi All

I have two object as 'objParent' and 'objChild' as master-detail relationship. I created a salesforce report to show all objChild records as per the Advanced Filter for objParent Id.

Now I want to use this advanced filer dynamically with query string parameter as 'pv0' like

https://na6.salesforce.com/<Report_Id>?pv0=<objParent_Id>

But when I tried with this trick, it it not working. Can any body help me to solve this issue?

Thanks
tstrongtstrong

I created something similar with a formula field on my parent object that is a hyperlink to my report.  I am passing the parent object ID throught this:

 

HYPERLINK("/00OQ0000000FF3G?pv0=" & Id, "Attendees List")

 

The bold text (00OQ0000000FF3G) is the report ID.

 

The link displayed on my parent object in this formula field is "Attendees List."

metakcmetakc

Hi Yr

 

Your trick is quite good but it works only in production/developer environment. When i tried it on my sand box account it doesn't work...

 

 has anyone faced this issue.. :mansad:

 

KC

tstrongtstrong
I did this in my Sandbox environment.  As long as you use the /reportID and not "https://na6.salesforce.com/reportID" you should be fine.
SForceBeWithYouSForceBeWithYou

Is your report saved with a field filter already in place... "objParentId" "equals" and then a blank value box?

 

If not, you need to edit the report to have this.  Other wise, you'd need to pass this in also through the URL:

 

pc0=ID&pn0=eq&pv0={!account.id}

 

This would take the account ID from an account record detail page (using the standard controller) and create a new field filter (even if one wasn't there, don't ask about overwriting, test it out instead).

 

Here's the problem:  you can probably manage to hack the handful of operator values for pn (eq, le, ge,.....) but the field abbreviations in the report URL format are definitely challenging.  I have no idea how to access custom fields yet, and there's no list of field acronyms.  For instance, "Last Name" on contact isn't "LAST_NAME", it's "LN".  So if you wanted a Contact Mailing List report generated on the fly to show "My contacts" with a last name column filtered for where Last Name equals "Smith", here's how:

https://(yourserverprefixhere).salesforce.com/00O?rt=2&c=LN&pc0=LN&pn0=eq&pv0=Smith

 

You might have some luck hacking the customize report page with Google Chrome developer tools to find these faster than experimentation.  This one is near and dear to me... Good Luck!

 

Cheers,

 

Nathan

IJBIJB

This is something I read on a youtube tutorial. It makes a lot of sense, but I couldn't make it work yet..

 

(...)

You can't pass pc0 as Object.FieldName - you have to pass in the Custom Object Field ID which you can find several ways, the easiest of which is to go to the field definition page (Setup > Create > Your Custom Object > Your Custom Field) and grab the 15 character ID from the URL. That should be the value of pc0.

 

(..)

 

This is the youtube tutorial URL

http://www.youtube.com/watch?v=8FE8gRGIGGM