Using XSLT to Create a Forms Server Link on a Task Form
Published 04/30 courtesy of SharePoint SolutionsWhen you use the Assign a To-do Item action in a SharePoint Designer workflow, a form is created that is presented to the user when they edit the task that the action created. This form allows the user to complete the task that was assigned during the workflow.
Located on this task form is a link to the related list item. When this related list item is an InfoPath form, a link is provided to the xml form, but unfortunately this link doesnt respect the open in browser directive that is selected on the form library advanced settings when the library is configured to forms server. Heres how you can make a change to the XSLT on the form to change the link to open the form using forms server.
First, open the aspx form that was created in the SPD workflow. Youre going to edit some of the form code. Go ahead the click the Split tab at the bottom to view the code and the form design.
Once the form is open, click on the chevron to open the Common Data View Tasks pane. If you cant get to the chevron, you can right-click on PlaceHolderMain and select Show Common Control Tasks. Check the box Show with sample data. This will display the table as shown.
While in the split mode, click to place your cursor in the cell to the right of the cell containing the label Related list item. Its the one that looks empty. Notice in the code window where your cursor is located. Find the <a> tag and all its related code. It should be similar to that shown.
<a href={substring-before(@WorkflowLink, , )}><xsl:value-of select=substring-after(@WorkflowLink, , )></xsl:value-of></a>
Now, change the code between the quotes in the href= as follows. Of course, you need to use your relative URL to the formserver.aspx page.
{concat(http://portal.awbikes.local/st/_layouts/formserver.aspx?XmlLocation=,substring-before(@WorkflowLink,, ),&OpenIn=Browser)}
You are using the concat function to create a link to the form server as described in MSDN at http://msdn.microsoft.com/en-us/library/ms772417.aspx. In this instance, the link will look like this:
http://portal.awbikes.local/st/_layouts/formserver.aspx?XmlLocation=URL-TO-XML-FORM&OpenIn=Browser
Now, when you click on the link you should see the form opens with forms services.
Subsequent recompiles of the workflow will not affect your form modifications. If you make a mistake and need to start over, simply delete the aspx task form and recompile your workflow.
Recent SharePoint Questions
- sharepoint Q&A function
- Customize "Send To" menu in Sharepoint 2007
- Site is opening only on Server but not on other clients. How to fix this?
- Handy & Free of Charge SharePoint Tools
- One Document - two sites
- What is the difference between a document library and a form library?
- What is Collaborative Application Markup Language?
- • What is the difference between SharePoint Portal Server and Windows SharePoint Services?
- Why should you use SharePoint?
- Displaying columns
more sharepoint questions
More Articles By
Develop Mobile Applications for SharePoint with Mobile Entree - CMSWire
Develop Mobile Applications for SharePoint with Mobile Entree
CMSWire, CA
By Barb Mosher | Jun 5, 2009 Seeing as how SharePoint (news, site) is so widely used within the enterprise today, it's…
Bamboos Year in Review: Marc OBrien Introduces the Bamboo Online Applications Division
Editor's note: Last year we introduced the Bamboo Year in Review feature, kicking off with a note
While writing the final sentences of my post on how to create a SharePoint blog last week, I realized that I needed to circle back and spend some time… I was asked the other day if there might be a slick CSS method for getting long column names to wrap in a SharePoint list’s new item form (NewForm.aspx). The… I’ve talked to a number of folks in recent months that have wanted to add the links stored in a user’s My Links list in their My Site to other… For a couple of reasons, Mission: Automation – SharePoint Workflow and InfoPath is one of my favorite classes to teach.Working with the Admin Links on your SharePoint Blog
More Articles Under "Articles"
How to get column names to wrap in #SharePoint new item forms (NewForm.aspx)
The My Links Web Part – It’s Not Just for My Sites #sharepoint
SharePoint Workflow and InfoPath Training… Online! #sharepoint
Most Viewed Content
- Develop Mobile Applications for SharePoint with Mobile Entree - CMSWire
- Bamboos Year in Review: Marc OBrien Introduces the Bamboo Online…
- Working with the Admin Links on your SharePoint Blog
- This Week in Bamboo (June 28th - July 4th, 2009)
- Cisco Plans Office-Like Service, Andreessen Begins a Silicon Valley Venture…

