Nov 16, 2010

Dynamic Reports In Salesforce

Hi All,


This is about how we can create dynamic reports in salesforce .


Suppose if we want to show two reports with filter "Account Name equals abc" and "Account Name equals xyz". So there is no need to create two different reports for it, we can pass filter value in URL at runtime.


Now create two link which will redirect to a VFP, with the filter param value by which report will be filtered. Now this VFP will redirect to report URL, e.g https://....../<reportId>?pv0=paramValue. Value passed in pv0 will automatically become the filter value for the report. Now if I pass ?pv0=abc report will show me all account with name "abc" and if I pass ?pv0=xyz report will show me all account with name "xyz".


Like this if we have more than one filters then we can also pass values for them like pv0 , pv1 , pv2 and so on.




Thanks

5 comments:

  1. Hi, i have created a custom link on account detail page. the link works fine if there is no white space. this link works fine https://na11.salesforce.com/00OG0000002imXl?pv0=test+agency as it is an account "test agency" but it failed to pull the report when the account name is "test agency, LLC". the link is rendered as https://na11.salesforce.com/00OG0000002imXl?pv0=test+agency%2C+LLC. when i look the look report it removes the space between comma and LLC. please help.

    ReplyDelete
    Replies
    1. Add HexaDecimal value for Space and Comma followed by %.
      Check the values here ---> http://www.ascii.cl/
      Example: %20, %2D,...

      Delete
  2. This comment has been removed by the author.

    ReplyDelete