SharePoint Development Bookmark and Share   
 index > SharePoint - Workflow > How to use a Button/Hyperlink to Manually Start a Workflow?
 

How to use a Button/Hyperlink to Manually Start a Workflow?

Ok, I've never liked the process to start a workflow:

  • from the listing of items
  • viewspecific item in list
  • hit workflows
  • hit appropriate workflow

Far too many clicks for my liking. I've been looking for a workaround to this and the closest I could get was a hard-coded link in a custom XSLT data view.I started it off with a standard list view, includinga Status column. Within the XSLT, I've added...

<xsl:choose>
<xsl:when test="@Status='Ready-To-Go'">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('/hard/coded/url/to/Workflows/WorkflowName/WorkflowName.aspx?List=[hard-coded GUID]&amp;TemplateID=[hard-coded GUID]','ID=', @ID)" />
</xsl:attribute>Starta workflow Manually</a>
</xsl:when>
<xsl:otherwise><xsl:value-of disable-output-escaping="no" select="@Status" /></xsl:otherwise>
</xsl:choose>

The main problem of course is the amount of hard-coded things I put in there. Not only can I not seem to grab the URL of the sharepoint url, the list guid is hard-coded and the templateid is hard-coded.Really the only thing going for it is that ID that gets populated.

I'm sure there's many-a way to get this done with visual studio and I could probably even bundle the workflow so it could be applied elsewhere. Unfortunately, I'm unable to get into visual studio and I don't have access to change the server configuration.... Basically stuck with SPD.

If anyone has an elegant solution, please share?

tswaters  Tuesday, August 11, 2009 11:52 PM
Hi,
You can use EventHandler to add a hyperlink column after new ListItem created, then use this hyperlink to start a workflow.
The following link introduces how to write this EventHandler:
http://www.cnblogs.com/sumh/archive/2008/05/20/1203567.html
In that post, the hyperlink will navigate to a page(IniWrkflIP.aspx) to start workflow. If you like, you can start workflow directly from that hyperlink.
My blog: http://xiaoshatian.cnblogs.com
Windie Chai [MVP]  Wednesday, August 12, 2009 1:18 AM
Hi,
You can use EventHandler to add a hyperlink column after new ListItem created, then use this hyperlink to start a workflow.
The following link introduces how to write this EventHandler:
http://www.cnblogs.com/sumh/archive/2008/05/20/1203567.html
In that post, the hyperlink will navigate to a page(IniWrkflIP.aspx) to start workflow. If you like, you can start workflow directly from that hyperlink.
My blog: http://xiaoshatian.cnblogs.com
Windie Chai [MVP]  Wednesday, August 12, 2009 1:18 AM
How, exactly? I'm still fairly new to Sharepoint and I have a situation where I need to add either a link or a button to the rows in a webpart generated by Sharepoint from a tasklist. I've gotten to where I can add a button or list in designer by first adding a column, but I still don't know exactly how to launch the workflow. I don't want to mess with event handlers. I just need something the user can click on and run the workflow when they are ready.

Can you help point out the specifics of how to do it?

Thanks
jdangiel  Tuesday, August 25, 2009 6:22 PM

You can use google to search for other answers

Custom Search

More Threads

• Problem in starting workflow programatically
• Collect Data From User Step Causing Error after collect
• How can I change my custom condition for SharePoint Designer Workflow?
• recupereat value of current content type lanched by workflow
• Assigned To Group doesn't work with SPD Workflow
• how to move a SPListItem from a GenericList
• Designer workflow for dynamically updating a calculated column everyday
• OOB Approval workflow-- can I modify the task form?
• Creating new workflow
• WSS3.0 and using workflows