Thursday, March 21, 2013

Set custom task field value in Start Approval action in SharePoint Designer


In this post we are going to see how you can set custom field that is in the task list from the designer when you use Start Approval action.

First take any list into consideration. Open SharePoint Designer 2010, connect to the site. Click on list workflow, select that list and create a workflow, give a name and description. and add start approval process action to designer.



Set it like this.



Now click on Approval. This will take you to the form where you can customize the entire approval process.



We are interested in change the behaviour of single task.

But before moving into this, observe task form fields on right. We need to create one task form field in this. Click on new. If you already have site column defined, you can click on add from site columns.



as you can see it is set to optional.



Now click on change the behavior of single task.



Before you can access task field. Go ahead and publish the workflow.

go to tasks list and list settings. Observe that designer has created a field for you.



Coming back to the designer add set task field to value action.



You will get the WF name field here select WF Name



and set the value to Order WF. Go to the workflow settings screen and select start workflow on create and on edit.





Save and publish the workflow. Go to the orders list and add an item. You can see workflow has started.



Go to task list.



Now if you click on the task title, you can see the WF Name field is shown on the form



go back to designer and go to the customizing approval process.

From the task form fields, set from optional to hidden. Now save and publish the workflow.



Again click on task list item and see that field is not visible on the form now.



I hope this helps. 

No comments:




Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com