Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am doing an approval process which (I think) requires a custom form. It would look something like this.

User uploads item to a document library. This document item contains individual list items that will be inserted into another list on the site upon upload of the document. For reference, both document items and list items have "Doc No." used for referencing to which doc item a list item belongs to.

The approval process needs to be, all list items for a particular doc item must be approved. Additionally, each of these individual line items each have different persons they are assigned to.

Here comes the tricky part. I need to create a custom task form for the doc items workflow so that the individual list items for each doc item are listed and can be approved there (checkbox). These list items can be grayed out / disabled depending on the access permissions the user has for the list items (specified in #2).

I already have a plan on how to check whether all line items are approved. I am having trouble with the creating custom task form part.

Any help you can give me? What do you suggest to use to create the custom form? Thanks!

share|improve this question
add comment

2 Answers

InfoPath is going to be your best bet for your custom workflow forms. Though this information is for 2010, it still applies: http://msdn.microsoft.com/en-us/library/ms573938(v=office.14).aspx

share|improve this answer
add comment

InfoPath isn't always an answer; however, there's no particular reason why you can't make a special task editform and then drive people there instead of to the default editform. This is essentially what I did in a solution I created earlier in the year. You'll need to more or less do the following:

  1. Instead of relying on the workflow to create a task email for you, make a custom email. I used the SPUtility.SendEmail method to do this. Within that, you can basically make the email look however you want it to (depending on how handy you are with HTML, anyway), and that includes driving the recipient to a custom task form.
  2. Passing the item ID to your application page is as simple as embedding it in the query string, which is exactly how SP sends requests to the built-in edit pages in case you're worried about security.
  3. Speaking of security... one of the things that I did in my solution was when I created the task item I also changed its permissions so that only the approver and admins could view it. If you right the code in the steps below correctly (i.e. don't run it with elevated privileges) this should automatically prevent non-approvers from typing in their own URLs and approving stuff they shouldn't be approving (if this is an intranet, that's probably not a big deal anyway, but just in case...).
  4. Since you can basically drive the user to any application page or what have you that you want, you've got a couple of options here. One is to go into Designer, create a default editform via the tools, and then delete/change around the fields therein until you've got something that you want. In your sample, you might want to use a task list with some customizations including a Multichoice field called DocItem (this would work if the choices people had are the same from one doc to the next). You can also just as easily create something in basic old ASP and then simply use the SharePoint API to create/update/delete the items (I did the latter, not because I was quite in the situation you're in but because I only wanted to change several fields, only wanted users to access a couple of them at a time, and then change several others behind the scenes, but your mileage may vary).
  5. If you're wanting people to update items on the fly without first having to hit a submit button, you'd want to include JavaScript on the page as well to do this.

I don't think that InfoPath is necessarily going to get you everything you want, particularly if you want to use one form to edit several list items. Unfortunately, the big downside of creating your own custom application pages is that it's a lot harder to leverage all the things that come OOB with SharePoint like rich text editors for Text fields or the little calendar widget for Date fields (which runs server-side anyway and is therefore kind of a PITA). It's not necessarily an easy task, but that's why we get paid the big bucks, right?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.