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
ArunaAruna 

How to create a report by passing parameters through link or button click

Hi.

 

can any one tell me how to create a report by passing parameters through link or up on button click.

 

is it possible by point and click functionality or do i need to go for custom vf page .

 

 

Thank you.

 

mikefmikef

You can pass in variable information into your report, but please note this is not supported by SFDC, but it has worked every since I started with the platform 7 years ago and still works today.

 

First step:

Create your report. Make sure the report is saved somewhere other then your customer report folder.

 

Second step:

Add all the filters you need, ie if you want to pass in the State value create a fileter ShippingState equals and leave the value box blank.

 

Third step:

Create your button to the report. use the id of the report. ie. /00O800000044Dq6?pv0={!ShippingState}

 

Now you see the /ID and then after that is a '?' that starts your url query string. The 'pv0' is the first value box in the report filters, so if you want the second you say pv1 and so on.

 

It takes some playing with but it's easy to get up and running.

 

Some negative issues are if a user changes your report the button might not work correctly, and there is no error checking for null values.

 

Good luck.

ArnoldPriceArnoldPrice

Mike,  I'm trying to pass on the Account ID but I get an error but get this error:  Error: Field AccountId does not exist. Check spelling.

00O160000075DdT?pv1={!Account.Id}

ArnoldPriceArnoldPrice
Mike,  I got it to work...nice!  Thanks for posting this suggestion.

-A