So the first step is actually setting up a parameter that will fetch the CRM URL for the environment you're currently in. To do that, create a new parameter and name it CRM_URL. The name is the important part here. Any parameter prefixed with "CRM_" is considered special when you upload the file to CRM.
The data type of the parameter is text and the parameter needs to accept NULL values. The prompt can be anything. I tried "bob" and it worked. And while most sites tell you to set the parameter as hidden, when you upload the report into CRM it should overwrite whatever you have in there to hidden. I didn't have any problems with visible or internal settings - CRM changed it to hidden when I uploaded it.
In the available values section, make sure it's set to none.
In the default values section, choose specify values. This is one of the parts that got me. If you don't specify a NULL value, the parameter won't return anything.
Finally, you should be able to leave everything in the advanced section as the defaults.
That should get you to a working, dynamic URL in CRM that automatically adapts to any environment you move your report to. But also keep in mind that I couldn't get any of this to work in Visual Studio. Only once I uploaded the report to CRM did the parameter actually populate and the hyperlinks work.
This is all well and good, but there's a problem with this. If you try to use this in a subreport or drilldown report it won't work! Subreports won't work with CRM's special parameters. So what now?
Well, the answer is fairly simple. You need to set the parameter up in both the main and subreports, then pass the parameter to the subreport. That's kind of a pain in the butt, but it's the only way this works. Once you do that, the dynamic hyperlinks should work in both the main and subreports.
If you're not sure how to setup those dynamic hyperlinks, see the post I made yesterday HERE.



No comments:
Post a Comment