Create a SharePoint 2013 search list column column. Visual Studio 2012 List Designer

I am trying to use the Visual Studio 2012 SharePoint 2013 list designer to create a search field, but it does not work.

Using the constructor, I created a simple list of (ad agencies) with a column (agency name) that I want to display as a search column in the second list.

Again, using the constructor, I created another list and add a Lookup column. Then, using the property bar, I set the following properties for the Lookup column in the Type section.

List: Advertising Agencies
ShowField: agency name

I deploy the solution and add the item to the list of advertising agencies. Then I add the item to another list, but the search agency column does not contain anything.

I hope someone can understand what I can do wrong, it seems so straightforward.

thank you for reading

+6
source share
2 answers

Decision

In the properties of the search column (i.e. using the property bar), use the values โ€‹โ€‹below:
List: Lists/Ad Agencies (Note: we use "Lists /" in front of the list name)
ShowField: AgencyName (Note: there is no space between the Agency and the name)

More details

List:

This is the value of the โ€œurl url (site url)โ€ of your parent list; found on the List tab in the list designer in visual studio 2012
enter image description here

ShowField:

This is the value of the name property of your field in the parent list, which should be used as ShowField (as shown in the property bar) (note: this is not the value of the display name property)

enter image description here

See below on the blog for more details.

http://jsuhail.blogspot.com/2014/08/add-lookup-column-through-visual-studio.html

+5
source

Ok, I found the question I had. I renamed the name Column. Do not do it. It causes all kinds of problems when trying to add list items using the list view.

If you rename the original header field, you need to refer to it as

 List: Lists/"Your List URL" ShowField:Title" 

no matter how you change the name of the name. Oh, don't think about changing the static name in the schema. This does not scare SharePoint. Oh, you can change the view to display the renamed header field, but when editing it using the list editing view. SharePoint is confused.

It is best to remove the starting column and create a new one. Then you will have no problems at all.

I repeat DELETE starting column called Title. Then create your own if you do not want to use the header field.

0
source

Source: https://habr.com/ru/post/951818/


All Articles