One of my friend came to me with a question on how to create a SharePoint List Lookup column. He had gone through several approaches (Programmatically and Declaratively) and he was asking for a recommended best practice way. I remembered a bit how I did that before but was not so sure the exact steps. Then I put my hands on and was trying to do a POC and had to spend some time on it. So thought its valuable to blog it so I will have a reference back for my self.
Scenario for my POC was a typical one, Department and Employee Lists. So I want a lookup field inside the Employee list so I can pick Department from a lookup column.
Step 01: Create a list that will contain data for the lookup list. In my case it will be department list and below are the properties of it
List Name = “Departments”
List URL = “Lists/Departments”
Field name that I want to lookup = “Title” Continue reading
In a previous post I discussed how to retrieve some values from a SharePoint list and bind it to a drop down list (HTML select). Later I had a requirement update back the selected value of the drop down to another separate list. The values I was retrieving was a lookup field in the second list I wanted to update.
My previous article on retrieve list data : Retrieve Data
So had to spend some time to properly understand how to do the look up field update using client object model.
I added a html button and wrote down a onclick event for the button.
<input type=”button” value=”Submit” onclick=”createListItem();” />
Below is the complete ECMAScript for the new list item update. It contains the two callback functions for successful item creation and failure of item creation. After a successful item creation, the new list item id will be displayed in a alert. Continue reading
When you work with SharePoint Lists you may have noticed that you will get a small context menu for each list item. Usually this content menu show up in the first column. (Title or Name column). But recently I had a requirement to show this context menu for a Person (User Presence) column.