Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

SSRS Report With Dynamic Navigation Links

Posted on by

We are on CRM 2016 on-prem. I'm building an SSRS report to show all phone call & task activities. For each activity, I have a hyperlink to navigate to the record. I need to give the users the link to the Regarding record of that activity as well. The syntax for the navigation link requires the logical name for the entity (=Parameters!CRM_URL.Value & "?ID={"&Fields!regardingobjectid.ToString()&"}&LogicalName=opportunity").  I could hard code the logical names based off of the objecttypecode in the sql query but there are too many entities to account for, the objecttypecodes differ from environment to environment, we would have to update this list as we create new entities, and not to mention that hard coding is just a horrible idea. 

 

In order to grab the logical names dynamically, I was trying to use the lookup function in SSRS to lookup the name from another dataset using the EntityView view, but this didn't work.  We tried to create a "filtered" view in another database and use the lookup function but that didn't work either.

(=Parameters!CRM_URL.Value & "?ID={" & Fields!regardingobjectid.Value.ToString() &"}&LogicalName=" & Lookup(Fields!regardingobjecttypecode.Value, Fields!ObjectTypeCode.Value,  Fields!Name.Value, "DataSet1"))

 

 I wanted to see if anyone had any ideas on how to get the entity logical names dynamically in order to populate the name into the syntax.  

 

Thanks in advance,
Chrys

*This post is locked for comments

  • talk2.gauravb Profile Picture
    talk2.gauravb 120 on at
    RE: SSRS Report With Dynamic Navigation Links

    Hi,

    I understand the object type code changes in each and every environment, i have personally faced it. The suggested solutions for your issue are:

    Solution 1:

    Create a new entity with three columns (Entity Name, Object Type Code, Filtered View Name), populate this entity only once and it can be used as a dataset in your report and whenever you have to use it to build link use lookup function.

    Solution 2:

    Use entity table in your report and from the view only extract columns which are useful for eg: object type code and entity logical name. Put these data into a dataset and whenever you have to use it to build link use lookup function and find the correct object. Using this solution benefit is you dont need to do any data entry.

    Regards Gaurav

    Happy CRM!NG

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: SSRS Report With Dynamic Navigation Links

    Hi,

    the workflow would be much more easier, and it is supported. In future you dont have to worry when move to Online. :) So the effort is worth it.

  • ChrysDW Profile Picture
    ChrysDW on at
    RE: SSRS Report With Dynamic Navigation Links

    I appreciate your reply. Unfortunately, I believe the workflow idea may not be worth the effort UNLESS the business really pushes for this. The query will not work because I can only report on FilteredViews.

    Thank you again for your ideas. They are much appreciated,

    Chrys

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: SSRS Report With Dynamic Navigation Links

    Hi,

    I would create a field in the record, and a workflow to update this field using dynamics url. direct query this field.

    but if you want to stick with your method. You can use below method to query the logical name based on objecttype code. (need some tweak on the code)

    arunpotti.wordpress.com/.../how-to-get-list-of-all-entities-display-name-logical-name-and-other-info-using-sql-query-in-mscrm

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans