Pass a ListItemId to SharePoint workflow

In SharePoint Designer 2007 open the page where an action is needed.

Right click the control the wher you want to start the workflow from… click Form Actions.

Add Custom Action and click Settings and the Workflow Wizard will start.

Click Variables and add a variable called something like MyListItemId.

Finish the workflow and see that the code around your control will be updated somewhat like this:

<a href=”javascript: {ddwrt:GenFireServerEvent(‘__workflowStart={{FA532C23-6F80-4266-868D-1EBC219A7E11},New,{8F0B8599-4B45-421A-A4A2-9BD2817078DE},}’)}”>
//MyControl//
</a>

 

Here’s what you need to do to pass the variable MyListItemId

<a href=”javascript: {ddwrt:GenFireServerEvent(concat(‘__workflowStart={{FA532C23-6F80-4266-868D-1EBC219A7E11},New,{8F0B8599-4B45-421A-A4A2-9BD2817078DE},MyListItemId=’,@ID, ‘}’))}”>
//MyControl//
</a>

 

EASY AS PIE

Advertisement

3 thoughts on “Pass a ListItemId to SharePoint workflow

  1. Does not work.

    SPDataSource – eCard_x0020_Gallery1

    @FileLeafRef,Name (for use in forms);@FSObjType,Item Type;@File_x0020_Type,File Type;@Title,Title;@ImageWidth,Picture Width;@ImageHeight,Picture Height;@ImageCreateDate,Date Picture Taken;@Description,Description;@Keywords,Keywords;@Category,Category;@ID,ID;@ContentType,Content Type;@Created,Created;@Author,Created By;@Modified,Modified;@Editor,Modified By;@_CopySource,Copy Source;@CheckoutUser,Checked Out To;@_CheckinComment,Check In Comment;@CheckedOutTitle,Checked Out To;@CheckedOutUserId,ID of the User who has the item Checked Out;@FileDirRef,Path;@HTML_x0020_File_x0020_Type,HTML File Type;@IsCheckedoutToLocal,Is Checked out to local;@_SourceUrl,Source Url;@_HasCopyDestinations,Has Copy Destinations;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;@File_x0020_Size,File Size;@_UIVersionString,Version;@ParentVersionString,Source Version (Converted Document);@ParentLeafName,Source Name (Converted Document);


    1

    {EA77196D-1CC5-4EEF-9E82-E1C6881E5B6A}

    xsl

    0

    1

    javascript: ;
    Start
     

    javascript: history.back();

     


     

    javascript: ;

    2ColFrm

    URL Path:

    date

    number
    text

    ‘ + this.options[this.selectedIndex].value + ‘

    :

    javascript: ;

    true

    (Empty)

    true

    true

    (All)

    true

    nothing
    filter

    javascript:

    Hide Filter Choices
    Filter
    Change Filter

    .
    Title

    text

    SharePoint Designer cannot render the XSLT in this Data View. Try to undo your changes or re-insert the Data View.Failed setting processor stylesheet : 0x80004005 : Expression expected. javascript: {ddwrt:GenFireServerEvent(‘__workflowStart={{CCB5FE8B-76EF-4951-A372-AC8A687A2664},New,{8F60EFD6-D47D-4E0E-A65E-2A688E0E78B0},myVar=’,@ID,–>}<–')}

  2. Pingback: Starting custom workflow from custom form page | Question and Answer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s