Create a multi-level approval workflow integrated with infopath forms in Sharepoint 2010
Posted on 2010-11-16
I am developing an applicationcalled "Software Request Form". The form is designed using infopath. Now I want to create a 2/3 level approval workflow, which should submits the form to the manager for approval. Manager would be able to add commnet and approve/reject form. If manager approves it should submit to the IT dept for further process. IT dept will also be able to add IT related data for the form and then submits for IT managers approval. Finally IT manager will add comment and approve/reject the form. How can i achieve this?? one more thing is that, i have 3 sections in my form, one for user,another for manager and another one for IT dept, i have hidden the sections based on the people in infopath but if the workflow runs, i need to achieve the same using the workflow in the Request form i created... is is possible??
This is what I did:
1) I add the GetUserProfileByName web service that SharePoint exposes
2) I check the identity of each user who opens the form using the userName() function
3) I hide/show and lock/unlock sections based on the logged-in user, including approval buttons (even digital signature sections, if necessary)
4) I keep the entire process in one form library.
5) I use a lot of hidden fields in my main data source that saves identity information about submitters, managers, and whoever else needs special permissions (e.g. IT)
6) I use those hidden fields of saved user info to establish conditions in my workflows
7) I iteratively run my SPD workflows depending on what happened when the form was last edited. If the initial user submits, I trigger an email to that person's manager (automatically using the web service from step 1, which can detect a person's manager). After the manager submits an approve or reject, I trigger an email notifying everyone and alerting the IT person that it's his (or a group's) turn to process at which point different areas of the form are available, and different workflow rules trigger.
Everything is working fine but I am not sure about the best practice for the above problem. Is there any other process that I can follow?
What is the best practise for the above problem?