Thứ Hai, 29 tháng 3, 2010

Cascading Drop-Down List in SharePoint 2010 using InfoPath 2010

Cascading drop-down is a common business requirement. SharePoint 2007 does not support cascading drop-down list by default. User have to write custom SharePoint field and it’s not easy to implement. With SharePoint 2010, User able to customize SharePoint form in easy way by using the powerful of InfoPath Designer. Following is the step guides to create a cascading drop-down list solution in SharePoint 2010 without require a lot of IT knowledge.

Scenario: We build a cascading for Address List. We have three list: City, District and Ward

1. Create City List

- In SharePoint 2010, create a custom List and named as “City”

- Add Two Item to this list: Hanoi and TP HCM

2. Create District List

- In SharePoint 2010, create a custom List and named as “District”

- Create a Lookup column named as “City”. This column get information from City List in the column Title.

- Add 4 items to District list

A21319952F68E79E_694_0[1]

3. Create Ward List

- In SharePoint 2010, create a custom List and named as “Ward”.

- Create a Lookup column named as “City”. This column get information from City List in the column Title.

- Create a Lookup column named as “District”. This column get information from District List in the column Title.

- Create on Add new Item link you will see. When we choose City, District still have 4 item.

A21319952F68E79E_694_1[1]

4. Customize Ward form to meet cascading requirement

- In Ward List, click on Customize Form ribbon button

A21319952F68E79E_694_2[1]

- System will automatically open the form template of Ward list in InfoPath Designer

A21319952F68E79E_694_3[1]

- Right click on District drop-down list control then select Drop-Down List box Properties from menu to open the properties windows

A21319952F68E79E_694_4[1]

- In Data Source. Click on Add button

- In Data Connection Wizard, click on Next button

A21319952F68E79E_694_5[1]

- In Select the source of your data, choose SharePoint library of list then click Next button

A21319952F68E79E_694_6[1]

- In SharePoint Site details screen, click on Next button

A21319952F68E79E_694_7[1]

- In Select a list of library, choose District the click on Next button

A21319952F68E79E_694_8[1]

- In select fields: Choose Title, City, ID then click on Next button

A21319952F68E79E_694_9[1]

- In next screen, choose Next button

A21319952F68E79E_694_10[1]

- Leave the default name for the connection as “District1” then click Finish button

A21319952F68E79E_694_11[1]

- Now, You will see the Data Source of Drop-Down list box is District1

A21319952F68E79E_694_12[1]

- In Entries section, click on the tree button to select XPath

- In Select a Field or Group dialog, click on Filter Data… button

A21319952F68E79E_694_13[1]

- In Filter Data click on Add… button

A21319952F68E79E_694_14[1]

- In specify Filter Conditions, in the first drop-down list choose Select a field or group

A21319952F68E79E_694_15[1]

- Select a Field or Group opened. Select District1 as Data Source, choose City in dataFields then click OK

A21319952F68E79E_694_16[1]

- In specify Filter Conditions, in the last drop-down list choose Select a field or group

A21319952F68E79E_694_17[1]

- Select a Field or Group opened. Select Main as Data Source then choose City in dataFields then click OK

A21319952F68E79E_694_18[1]

- Click on OK to close specify Filter Conditions dialog

- Click on OK to close Filter Data dialog

- Click on OK to close Select a Field or Group

- In Drop Down List box properties, choose d:ID in Value: section then click OK to close this

A21319952F68E79E_694_19[1]

- In InfoPath Designer, close the Windows then choose the Save and Publish button

A21319952F68E79E_694_20[1]

- After Publishing complete, back to Ward list then click on Add new item link. You will see the result

A21319952F68E79E_694_21[1] A21319952F68E79E_694_22[1]

Two drop-down list has been cascading.

Conclusion

SharePoint 2010 provides a easy way for none IT to custom the look and feel of SharePoint by using InfoPath Designer, SharePoint Designer. Customize form in InfoPath Designer 2010 is a great new feature of SharePoint 2010. It’s cool!

Không có nhận xét nào:

Đăng nhận xét