none
Add link to OPEN THIS TASK in email for approval workflow

    Question

  • I would like to add a dynamic link in the email that goes out for an approval

    3. Use the Open this task button to mark the task as completed

    Instead of the user using the Open This Task button in the ribbon to navigate to the Accept/Reject page, I want to add the link in the #3 instructions so that they can just click there.

    Is this possible in SharePoint Designer 2010?  I've tried a couple of data source / Field from Source combinations but none of them take me to the Accept/Reject page.

    Thanks for any help.

    BK


    BK Wiedo
    Tuesday, April 26, 2011 4:13 PM

Answers

  • After further testing, I believe I have found the field that provides the URL to the Approve/Reject page.  It is the [%Current Task:Form_URN] lookup that provides the information.  No building out necessary. That was one of the fields that I had not included in my email test and turns out to be provide the url.

    I appreciate the help provided.


    BK Wiedo
    • Marked as answer by BK Wiedo Thursday, April 28, 2011 9:07 PM
    Thursday, April 28, 2011 9:06 PM

All replies

  • Hi,

    If you want to  add a link in the email,  you can create a custom e-mail alert handler using IAlertNotificationHandler interface to intercept the e-mail alert and modify it. This KB948321 article has detailed steps on how to create custom e-mail alert handler, although it is for MOSS 2007 : http://support.microsoft.com/kb/948321


    Xue-Mei Chang
    Thursday, April 28, 2011 8:53 AM
  • Thanks Xue-Mei,

    I'm looking to see if a solution is possible in SharePoint Designer 2010 using the capabilities of it without doing anything custom.  In the Start An Approval action, I'm looking to see if there is a datasource/field lookup or multiple lookups that reference the Task Approval link or possibly be able to build out the link. 


    BK Wiedo
    Thursday, April 28, 2011 2:39 PM
  • Hi BK Wiedo,

    How you go about this is going to depend on your context, that is: is the current item id relevant to you, is the current list id relevant to you, can you perform a lookup to get the correct list item id, etc.

    But, that written, most of the time you can built a link using a combination of workflow context site lookup and a mix/match of other static and dynamic data. For example, I author workflows which send out links to access tasks, and do so as follows -

    [%Workflow Context:Current Site URL%]/lists/listname/editform.aspx?id=[%Current Item:ID%]

    This built URL is useful when I fire the workflow when the task is created or changed. Something similar to the above is probably what you are looking for. Note: [%Workflow Context:Current Site URL%] is available from

    Data Source = Workflow Context

    Field from Source = Current Site URL

    Return field as = As String

    HTH,

    Chris

    Thursday, April 28, 2011 3:08 PM
  • Thanks Christopher.  I believe this is the approach that I will have to take.  While searching for the components to build out the URL, I must be overlooking where the components are.

    The following is the URL that is shown when a "Copy Shortcut" is done on the task.

    [%Workflow Context:Current Site URL%]/_layouts/listform.aspx?PageType=  (Don't see Page Type as an option in any of the data sources)

    &ListID= (Not finding this one)

    &ID=[%CurrentTask:ID%]  (Found this one)

    &ContentTypeID= (Not find this)

    I believe if I can find these values, I would be able to create the link.

    Again, this is the link to the Approval Task that you go to when you are assigned an Approval and that you get to from the "Open This Task" button for Outlook 2010 users and the "Edit This Task" button for 2007.


    BK Wiedo
    Thursday, April 28, 2011 7:46 PM
  • After further testing, I believe I have found the field that provides the URL to the Approve/Reject page.  It is the [%Current Task:Form_URN] lookup that provides the information.  No building out necessary. That was one of the fields that I had not included in my email test and turns out to be provide the url.

    I appreciate the help provided.


    BK Wiedo
    • Marked as answer by BK Wiedo Thursday, April 28, 2011 9:07 PM
    Thursday, April 28, 2011 9:06 PM
  • Hi BK,

     

    PageType can be static '4'. This is the display form for list items. For more info, check this out: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.pagetype.aspx

    ListId is the GUID of the list where the task resides. You can find this by opening up the Task list for the workflow, and copying the List ID value from the List Information dialog in SPD. I'm pretty sure the List ID will remain the same during site migration (double check this).

    I don't think you need ContentTypeID, but I'm pretty sure it's referring to the content type of the associated list.

    Thursday, April 28, 2011 9:37 PM
  • How do get the  [%Current Task:Form_URN]  in the workflow editor that starts the approval process?

    I can find it only when editing the aproval workflow itself


    Ofer Gal

    Wednesday, June 27, 2012 7:53 PM
  • Ofer Gal,

    Take a look at the detailed walkthrough in Stephen's post in this thread:

    http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/2a89374e-acfc-4960-887f-dc20eb328ed6?prof=required 

    Thursday, September 06, 2012 9:07 PM