Friday, May 20, 2011

Create an approval workflow In SharePoint designer

 To create a Workflow in SPD 2010 see this video http://office.microsoft.com/en-us/sharepoint-designer-help/video-create-an-approval-workflow-in-sharepoint-designer-2010-VA101897477.aspx

I used the SPD 2007 to create an approval workflow for an InfoPath form library.
It had to work by sending an email and getting the approve or reject status to a form an approver, then send emails to users, notifying them of their status
The only thing was, that the approvers had to be a list of users who would be selected from the InfoPath form .
I started off from here http://www.u2u.info/Blogs/Kevin/Lists/Posts/Post.aspx?ID=39
Thats a cool post that help to start off (and end ) . Thanks Kevin.
here's a nice post too http://cycogeek.fiesta25.com/blogs/cycogeek/page/Create-Custom-Approval-Workflow-with-SharePoint-Designer.aspx
In the step called 'user' (in the above link) I had to choose a variable from the InfoPath form. please refer to my earlier posthttp://saudkhansblog.blogspot.com/2011/05/send-mail-from-infopath.html form sending mail from InfoPath.
After gathering the approver process and other variables, namely- comments and approve
I had to send two mails at once, ie. one to the creator and a cc to the person holiday is requested for.
If it were the same person, then it should send just one email, else should send two mails .
This can be done by adding 3 else if conditions, (and the first if , so totally 4)

like :
if Holiday Approve equals Approve
and if created by equals accountID
then send one mail to created by(approved mail)
else iff Holiday Approve equals Reject
and if created by equals accountID
then send one mail to created by(reject mail)
else if Holiday Approve equals Approve
and if created by not equals accountID
then send mail to created by with cc to accountID (approve mail)
else if Holiday Approve equals Reject
and if created by not equals accountID
then send mail to created by with cc to accountID (reject mail)

not another thing when you send the mail, you send the URL form current items, dont do that
coz if the url has spaces it won't work
Use EncodedUrl instead, this will have the whole correct path to the document.
If you need any help just ask
Thanks


No comments:

Post a Comment