Saturday, January 9, 2010

SPD Workflow Email hyperlink bug

It seems like SPD workflow bug ..but not sure if anyone else face the similat problem or not.

In SPD workflow email body if you want to create a hyperlink then it always remove the first space it encounter in that hyperlink. For example if I have a hyperlink as follows;

<a href="https://servername/test.aspx?QS1=">click here</a>

When user gets this in email, the link comes as follows: https://outlook.servername/owa/redir.aspx?URL=https%3a%2f%2fservername%2ftest.aspx%3fQS1%3dtest%0d%0user1%26QS2%3dtest+user2

If you observe here in above link, the first space between test and user1 has been converted into “%0d%0" which is a carriage return/line feed, but the space between the test and user2 converted to "+".

Now when user click on this, the browser converts this to https://servername/test.aspx?QS1=testuser1&QS2=test+user2

So it removed the space between test and user1 for QS1 but QS2 has retained the space. This means it remove the first space in the URL but it retains all other spaces. Its not big issue if its a static URL as we can alter the URL in the email body but if the URL is created dynamically then it will always sent the wrong URL in the email body.

Solution/Work Around
=================

I did not find any solution for this, but I solved this issue using a dummy query string variable in URL as a first query string with a space in it and added all my real query strings after that. So I converted my earlier URL as follows:

<a href="https://servername/test.aspx?DummyQS=test test&amp;QS1=test user1&amp;QS2=test user2">click here </a>

No comments: