Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

CRM 2011 SSRS Custom report Action Go to URL not working when multiple values using switch

Posted on by 90

I have a custom sql based ssrs report that I am deploying to CRM 2011. I am using the Go To URL under Action and it is working fine with single link but the field that I am creating the hyperlink for might come as account or contact so I have to use a switch or iif to get the proper link.

When I use a switch to branch out per the entity, I am having an issue as follows. Here is the code that is working:

=switch(fields!partyobjecttypecode.Value = 1, Parameters!CRM_URL.Value + "?ID=" + Fields!Client.Value.ToString() + "LogicalName=account",
 fields!partyobjecttypecode.Value = 2, Parameters!CRM_URL.Value + "?ID=" + Fields!Contact.Value + "LogicalName=contact")

As you notice, the below line has ToString() missing but the above line has it. Here, the account link works but the contact doesn't. When I add the ToString() to the line below exactly like line above both link stop working. If I add the ToString() to line below and remove it from line above, again, the contact works but account doesn't.

Do you see what is wrong here? Your help is greatly appreciated as I have been looking at this for several hours to no avail. Looking forward to your responses.

*This post is locked for comments

  • Joker Liu Profile Picture
    Joker Liu on at
    RE: CRM 2011 SSRS Custom report Action Go to URL not working when multiple values using switch

    Hi Homayoun, sorry to bother you. I met the same question with you, could please kindly show the working expression?

  • Verified answer
    HomayounAugust Profile Picture
    HomayounAugust 90 on at
    RE: CRM 2011 SSRS Custom report Action Go to URL not working when multiple values using switch

    Please disregard the question. I found the solution myself. I moved the ToString() conversion to the backend and it fixed the issue.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans