Form Action or Custom Action Start Workflows – SharePoint Designer 2010

Form Action links this article from Mindsharp

On the Data View Web Part, you’ll often see the wizard build "Form Action" links. They typically look something like:

<a href="javascript: {ddwrt:GenFireServerEvent('__commit')}">save</a>
<a href="javascript: {ddwrt:GenFireServerEvent('__cancel')}">cancel</a>

You don’t have to stop there, however: you can use them to tell the browser where to return to, or to simply navigate to another page, etc. But the real power comes from…

Form Action Workflows

Not tied to list. Instead, they’re called by clicking the link they’re associated with. As such, they don’t have built-in access to the "current item." However, form fields can be made available to workflow for the current record. Additionally, variables can be passed into the workflow at initiation which will imbed a great deal of flexibility’.

Create a custom action in SPD for the SharePoint Toolbar or List Item Menu. Choose what event you want to happen when you click the Custom Action as follows. You can do this from SPUI but there is more power in SPD.

image

image

Scroll down on the above box to enter in the image URL like this: /_layouts/images/uploaddoc.png

You cant add a single custom action to go multiple places so you have to create multiple actions with the same name, one for each place you want the button to appear.  You cannot start a workflow action on the New Form Ribbon targeting a workflow the user will get an error if they click on the action because an item does not exist yet. this is from here

The Navigate URL option is an href so you can add Java script like so javascript:alert("This werks") . So you can fill you boots and build many scenarios.

Tip from here as follows

This action is great to use with the StartWorkflow component http://spc3.codeplex.com/

For View Ribbon actions

javascript:SP.UI.ModalDialog.showModalDialog({url:"{SiteUrl}/_layouts/Com.CodePlex.SPC3/StartWorkflow.aspx?List={ListId}&ItemID={SelectedItemId}&Workflow=WorkflowName",dialogReturnValueCallback: function(dialogResult, returnValue) { SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK) }})

And for Display Form Ribbon actions

{SiteUrl}/_layouts/Com.CodePlex.SPC3/StartWorkflow.aspx?List={ListId}&ItemID={ItemId}&Workflow=WorkflowName

Advertisements