Below is the steps to follow.
- Define your list with all the needed fields and lookups
- Create a new custom form(s) - you will need a new New and Edit form. For details see this blog entry.
- Delete the existing List Form web part
- Add a Custom List Form to your page
- Create a new Data Source to use to get and filter your lookup data
- Open the Data Source Library
- IF your lookup list is NOT in the same site as your main list do the following
- Select Connect to another library (at the bottom of the Data Source Library window)
- Click Add
- Browse to the web site which contains the list with your lookup values
- Add a name to your source
- Click OK
- Find your list either in Current Site or the site added above.
- Right click on the list that will be your lookup source and select Copy and Modify
- A Data Source Properties dialog will be display
- Select the Fields you need
- Select the Filter you want to apply
- Select Sort to set the correct sorting order
- Click OK
- Id="THEID" - the same as the ID of the FormField just deleted
It is important to get all the steps right, but step 10 takes care of posting the data back to the list.Thanx to Dattard Zebug - which was the primary source on solving this challenge.
Issues and error sources:
- Suddenly the data source is not recognized any longer and you get a server error. SharePoint designer had added a '0' after the ID of my datasource name. Why? Ask Microsoft.
To create a cross-site lookup field do the following
- Create the list that you want to be the source of your lookup field - must be deone at the site collection root.
- Create a new Site Column (at the site collection root as well ) which you define as a lookup field and the liste created above as your source
- Use the new site column field in your new list - anywhere in the site collection
A lot of the limitations with the lookup field should hereby been solved and addressed - at least for the time being :-), Unfortunately no C# code was needed :-)