I
recently had a requirement where you need to call a report from a
custom button and that report should show only those contacts which are
related to that account on which Button is Clicked.
Its
very easy to do actually once you know that it can be done. I created a
custom button and passed in the Report Id but I wanted to be dynamic so
I applied a Filter on Report where AccountId = Null or you can leave
AccountId = "".
Now
in custom button I gave merge field where ID of Report?Pv0 =
{!Account.Id}. For eg: lets say the Report Id which we can copy from url
is 00O30000005uGHT then we writte in the Button Code :
00O30000005uGHT?pv0={!Account.Id}
This
PV0 is actually the Id of field Account Id used in Report. So now when
you click this button, it will call the pre configured report with
Account Name and Contact Name where a Filter has been applied of
AccountId = null. So when we call this report it passes the AccountId
and we see only that Account with its Contacts on Report.
I will not attach the complete Screenshots just to let you try this on your own first. All The Best :)
