In this webinar, our experts showcase a variety of demo use cases of how different components of the...
A cool capability of Microsoft Dynamics CRM reporting is to add an action to open a CRM record from a report. Not only is this cool from a CRM Superhero perspective but can save you time and mouse clicks. In this example report is a list report for a custom entity. I have a custom relationship to Accounts from the custom entity and I would like to allow the user to click on the Account name and launch the CRM Account record. This will work for both CRM 2011 and CRM 4.0
In your report development environment add a parameter for the CRM_URL. This is a unique CRM parameter that will discover the organization url and pass in the string we dictate later.
Next, determine which entity you will be launching. You can find it the sdk, the medadata browser or simply opening a record and hitting Ctl+N – this will reopen that CRM record in a new window with the Internet Explorer tool bar and you should find the Object Type Code or Entity Type Code. This number immediately follows the 'etc='
System entities will start at 1 (Accounts) and go up to 4 digits.
Custom entities will start at '10000' – such as the example below:
Back in the report development, locate the cell that contains the field that represents your selected entity. Right-click and select 'Text Box Options':
- Select 'Action', click the 'Go to URL' radio button and click the formula/expression button
- Paste in the following text:
=IIF(IsNothing(Parameters!CRM_URL.Value),system.dbnull.value,Parameters!CRM_URL.Value & "?ID={" & Fields!new_account.Value.ToString()& "}&OTC=1")
- Two elements need to be set for the link: The field and the OTC (same number as the ETC in the URL)
- Click 'OK'
- Save and publish the report.
- Run the report to test (previewing in your report development environment will not launch the window)
- Click the Account name in the report:
- Voile, the Account record will open!
CRM Reports can range from simple to complex so please reach out to our CRM Experts if your organization needs some help.
Happy CRM'ing!
Thanx for this.
This article came maybe 2 weeks to late for me. Now i have managed it for myself.
One Thing is an alternative to the link, you used in your article:
String.Format(System.Globalization.CultureInfo.InvariantCulture,
"{0}?ID={1}&LogicalName={2}", Parameters!CRM_URL.Value, Fields!accountid.Value, "account")
--
With this you have not to care about object type code ...
change
Fields!accountid.Value
an
"account"
to any other lookupfield / entity and it will work. This also works with own created entities.
Greets Pit
Thanks for the comment.
Yes, that definately works as well; my example followed the format the out of the box reports use.
Happy CRM'ing
Hi, If I want to open this subreport in new window, what should I do? Could you please help me on this?
Hi, I've managed to get the action to URL working for a simple field (using the below Parameter structure), however for a field that displays records from multiple entities I cant get it to work. Code structure works fine for returning the correct records, but doesnt seem to work for Parameters. I dont know if this a limitation of Action's or if I have made an error? Its very annoying to troubleshoot as it doesnt work in Preview
=IIF(IsNothing(Fields!Entity1Code.Value)=-1 and IsNothing(Fields!Entity2Code.Value)=-1
,Parameters!CRM_URL.Value & "?ID="& Fields!Entity3GUID.Value.ToString & "&LogicalName=Entity3"
,IIF(IsNothing(Fields!Entity1.Value)=0
,Parameters!CRM_URL.Value & "?ID="& Fields!Entity1GUID.Value.ToString & "&LogicalName=Entity1"
,Parameters!CRM_URL.Value & "?ID="& Fields!Entity2GUID.Value.ToString & "&LogicalName=entity2")
)
Any help appreciated!
I followed these directions word for word, I copied and pasted the expression above with the field and corresponding OTC number that i need, and the field is not a hyperlink. Also tried the instructions on http://salimadamoncrm.com/2013/08/01/ssrs-reporting-how-to-create-url-to-open-crm-forms/. With the instructions via this link, the field is then a hyperlink, but IE opens to https://reportserver... and my organization's CRM does not load. Is there a setting on the back end of CRM 2013 that I need to change? SSRS doesn't know how to open my organization's URL.