开发者

Sharepoint LookUp field on Choice field?

How to create a lookup field for the Choice field..For eg: In a list i have Choice field and i have to create an lookup column in other list pointing to this choice field ..When i select this list this column is not appearing in the dropdown...Please let m开发者_StackOverflow社区e know if there is any Limitation for that


It is not possible to create a lookup field for a choice (dropdown) field. There are two ways to resolve your problem: The programmatic approach and the workaround.

The programmatic approach involves an creating event receiver to do the magic - pretty work intensive. But there is an explanation here:

  • Sharepoint 2010 - How to use List Events to Set a Column's Value using Visual Studio 2010 (C#)

You can also just create another list, containing your choice field values and use a calculated field as a source for your lookup column. Check out the following explanation:

  • Using a lookup field on a choice field workaround


the programmatical Solution is at risk to run into an endless recursion:

The ItemAdded Event and UpdatedEvents are asynchrone. This means, that the command: this.EventFireingEnabled = false is not threadsafe. After systemUpdate you set EventFireingEnabled to true.

But because the ItemUpdated is asynchronus, you cannot guarantee, that the ItemUpdated for your system.update has already been called at this time!.


You can use calculated column is source list, that will display value of Choice column. Then you can add lookup column for this calculated field. It will work only for Choice column with single selection. For multiple selection you can use 3rd party components like that: http://www.sparqube.com/SharePoint-Lookup-Column


It works out of the box for me... but the lookup option is is only available if you go to "List Settings" and click on "Create Column" here is how I configured my column on sharepoint online (in 2019) and it works perfectly... this is copy and pasted from the list settings screen under this column...

Column name: Equipment List 
The type of information in this column is: Lookup 
Get information from: Equipment Master List 
In this column: "Equipment Name" (dropdown selector of all the column names on the other list)
Allow multiple values (to be selected)  [TICKED]

there are some notes lower down too..

Relationship A lookup column establishes a relationship between list items in this list and related items in the target list. Specify the relationship behavior enforced by this lookup column when a list item in the target list is deleted.

When an item in the target list is deleted, cascade delete will delete all related items in this list. Restrict delete will prevent the deletion of an item in the target list if it has one or more related items in this list.

Enforce relationship behavior [CHECKBOX]

radio buttions:
  Restrict delete
  Cascade delete
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜