We created a Task List for the internal portal to assign tasks within our team members. The Predecessor field in the Task list lists downs all the values entered for the Title field. It grows when we keep adding items to the list. To overcome this problem, we decided to add a field call Project and filter the Predecessor by projects. Following section describes how to achieve this.
To add values to the Project dropdown list, create a custom list named ‘Projects’ and use that list as a lookup field. Add some projects to the list. These project names will be displayed at the Task List at the dropdown list.
1. Next create a Task List named ‘Project Tasks’.
2. Create a Lookup column named ‘Project’, to list down available projects with the following information.
3. Next we are going to edit the form with InfoPath to do the customization. Click on the ‘Customize Form’ to open the form.
The form will be opened in InfoPath 2010.
4. Right click on Project field and select Drop-Down List Properties.
5. Select ‘Get choices from an external data source’ and click Add.
6. Create new data connection using the Data Connection Wizard.
7. Select Receive data option
8. Select the source as SharePoint library or list.
9. Select the ‘Projects’ list.
10. Select ID and Title fields.
11. Don’t select Store a copy of the data in the form template option.
12. Enter the data connection name as ‘Projects1’ and click Finish.
We have created the data connection for the Projects dropdown list.
13. Set the Value and the Display name properties as ID and Title respectively.
Next we need to do the same steps for the Predecessor field as well.
14. Right click on the Predecessor field and select Multiple-Selection List Box Properties and create a new Data Connection.
15. From ‘SharePoint library or list’ select ‘Project Tasks’, select ‘Title’, ‘ID’, and ‘Project’ column.
16. Don’t check the box for making a copy of the data in the form Template.
17. Do not check the box that asks for automatically retrieving data when the form is opened. Save the external data source as ‘Project Tasks1′
18. Set ID and Title for the Value and the Display name respectively.
We are almost done. Next we need to do the filtering for the Predecessor with the following steps.
19. Click on the xPath button at the properties dialog next to the ‘Entries’.
20. Click on the ‘Filter Data’ button and Click Add.
21. At the first column, pick ‘Select a field or group’.
22. A window pops up .Select the ‘Main’ data source, click on ‘dataFields’ and select ‘Project’
23. In the second column, choose ‘equals to’.
24. At the third column, choose ‘select a field or group’. Again a window pops up. Select the ‘Project Tasks1’ datasource, click on ‘dataFields’ and select ‘Project’. Click OK.
Your filter data will look like Project = Project. Next we are going to add some rules to the Project dropdown list.
25. Select the Project column and click on ‘Add Rule’. Select ‘The Field Changes’ and select ‘Query for Data’.
26. Now choose the Data connection ‘Project Tasks1′ and click OK.
27. Again add a new rule for the Project dropdown list. This time select ‘The Field Changes’ and select ‘Set a Field’s Value’.
28. Choose field ‘Predecessor’ and leave the value empty.
We are done now. Quick publish the Form. You will see the following when you try to add new item.