Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am creating a workflow in visual studio. This is what i want it to do....when triggered by creation of a list item i want it to send an email to a permission group with a link in the body to the SPListItem. I have added the SendEmail activity, created fields for From, To, Subject, Body in the code behind and in the MethodInvoking event handler i have set the From, To, and Subject. I am hung up on the body....when i tried creating the email in SPD this is what i came up with

Click this link to be taken to the new file.

<a href='[%Current Item:%]' >New PPM Testplan</a>

I am not sure what to set the body to in order to achieve this/whether you can use the [%Current Item:%] syntax in the code behind. help or a link to doing this in VS2010 appreciated

TIA

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

To link back to your item, you can do something like

"<a href=\"" + li.Web.Url + "/" + li.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + 
"?ID=" + li.ID.ToString() + "\">Link to Page</a>"

Where li is the SPListItem.

HTH!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.