Manually submitting a document to a workflow

  • 7 March 2008
  • 4 replies
  • 0 views

Badge +3

Hi there
I have a requirement to retrieve some custom properties from a document in a MOSS document library and populate some fields on an aspx page with them. The idea is that the user will manually select a document from within a library and be directed to a page which has these fields filled in.
I have written some code to retrieve these properties using the MOSS object model and if I have the correct SPWeb and SPList then I cann retrieve the properties. But I don't know how to proceed with this.

How do allow the users to manually submit the document, and how do I either get the location details of the document to my code, or retrieve thedocument properties and pass them to my aspx page?
Any ideas?

Many thanks


4 replies

Badge +4

Adding a custom action to the library sounds like a good approach (http://msdn2.microsoft.com/en-us/library/ms460194.aspx or http://msdn2.microsoft.com/en-us/library/ms473643.aspx) to get the user to the input form. Basically, you'd just add an action like "Select document" and they would see it in the document action menu and when they select it, it would send them to your form, etc and you'd be able to pass things like the document id so that you could lookup the data.


Another option is to just use the workflow capabilities of the document library and have them manually start a workflow on that document. This wouldn't be quite as seemless as this would just create a task for them to then complete the form, but you would know the document and the library, etc, and could retrieve the data.


 

Badge +3

Hiya


Thanks for the reply. It's a good idea, but the problem is I have to allow this for lots of document libraries, and to set a custom action against each library is impractical. It would be much better if I could do it for a content type.


As for using a workflow in the document library, I have no problem with that idea but I can't see how to upload a workflow from the K2 Studio designer, and I don't think a Web designer workflow will accomplish what I need. It doesn't seem to allow me to put any custom code behind it, or to redirect to a custom aspx page.

Badge +4

Well, unfortunately, you can't do a custom action on a content type, it only works for things like menus, etc. You can attach event handlers or workflow to content types though and that may ultimately be what you need to do since you are wanting to do this across a bunch of document libraries.


You are correct about the Web designer, you can't write custom code (although I believe you can create a custom event wizard and then potentially consume it from the web designer).


Using K2 Studio designer, if you look under the Process Wizards there are wizards to associate your workflow with the document library, etc. When you then deploy, it will deploy the workflow to SharePoint as part of the deployment process.

Badge +3

However with K2 Studio designer, any workflow I deploy to Sharepoint won't be available to allow me to manually submit a document to. I can associate it with an event but not manually submit to it.


I need to allow a user to select a document and ultimately display some of the documents custom properties inside an aspx page. I can display the properties if I can just get hold of the document and its location.

Reply