Harkernator

Hi,

I am hoping that it would be possible to edit the DispForm.aspx sharepoint designer to include a button/link that will manually kick off a work flow.

Does anyone know if this is doable

I'm going to also post in the forum related to Workflows.

Regards



Re: SharePoint - Design and Customization Create a button to start a workflow

Harkernator

BUMP!

Does anyone have any ideas





Re: SharePoint - Design and Customization Create a button to start a workflow

Curtis Ruppe (MicroStaff IT)

Yes it's possible, but it may require more customization (to include .NET coding) than what it's worth.



Re: SharePoint - Design and Customization Create a button to start a workflow

Harkernator

I'm not shy of a bit of .net coding.

If someone knows of any tutuorials or code samples I'll do it Big Smile





Re: SharePoint - Design and Customization Create a button to start a workflow

Curtis Ruppe (MicroStaff IT)

CustomActions are built just for this sort of thing. Create a CustomAction feature with a location of DisplayFormToolbar. Specify your appropriate ControlAssembly and ControlClass. Be sure to add your implementation to the SafeControls section.

Within the control, you would write the following code to start the Workflow.

Code Snippet

SPWorkflowManager wfm = new SPWorkflowManager();

wfm.StartWorkflow(SPContext.Current.ListItem, SPContext.Current.List.WorkflowAssociations.GetAssociationByName("workflowname", CultureInfo), eventData);

Although the following link is modifying the Site Actions menu, the concept is the same.

http://sharepointsolutions.blogspot.com/2006/10/quick-site-settings-adding-sub-menus_16.html

Good luck!





Re: SharePoint - Design and Customization Create a button to start a workflow

Harkernator

Ah this is one of the things that requires the Sharepoint add on for Visual Studio, which I don't have.

I am hoping instead then that I could just use a link with something like http://server/workflows/wfname/start.aspx listid= &itemid=

Or similar - is this possible





Re: SharePoint - Design and Customization Create a button to start a workflow

Curtis Ruppe (MicroStaff IT)

I'll give you a head start to a prebuilt way, but the problem is you will need to know the specific workflow you want to run, and somehow know the exact listitemid you are going to run the workflow on. CustomActions give you up to the listid, but never the listitemid, so good luck!

Go to your list in which you want to invoke the workflow. Click on any list item's drop down menu, and select Workflows. Hover over the appropriate Workflow you want to invoke via the DispForm.aspx page. You'll see the link you are looking for. You might be able to design your own DispForm.aspx page that will accomodate this link based on your specific listitemid.

By the way, the SharePoint add on is not required for what I was talking about doing. In fact for what I was talking about, the Visual Studio Extensions for WSS won't help out at all.