How to Start a SharePoint Workflow From JavaScript

by Jim Campbell

Microsoft Sharepoint allows developers and administrators to customize the server software interface. Sharepoint provides a company with internal file sharing and organizational features for each company department. Use the XSL change control interface to add a JavaScript method that opens the Sharepoint Workflow with the click of a button.

1

Open the Sharepoint editor and open the page you want to edit. Highlight the link or button you want to use to open the workflow chart. Open the "Content Editor."

2

Double-click the XL document to edit. Add the following line of code to link an "onClick" event to the link or button:

<xsl:attribute name=”open”> <xsl:text>Workflow Button</xsl:text> <xsl:attribute name=”onclick”>

3

Add the XSL JavaScript code to open the workflow:

<xsl:text>javascript:StartWorkflow(‘myworkflow');</xsl:text>

Change the "myworkflow" ID to the name of your own Workflow form.

About the Author

Jim Campbell has been a computer engineer for over five years. He excels in hardware repair, computer programming and troubleshooting, and software design. He is currently attending Florida Atlantic University, pursuing a master's degree in computer and electrical engineering and fine-tuning his technical writing abilities.