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
Hi Homayoun, sorry to bother you. I met the same question with you, could please kindly show the working expression?
Please disregard the question. I found the solution myself. I moved the ToString() conversion to the backend and it fixed the issue.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156