.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to populate 2 custom list fields from one selection in a 'people or groups' selection

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :SharePoint

Hello everyone, I'm new to the forums.

I need to create a custom list that has the fields:

  • Name (get by People or groups - searched via e-directory)
  • Job Title
  • Picture

Now I want Job title to be auotimatically filled in depending on what name the user selected from the first option.  The actual date in e-directory already has the person's job title, so it seems resonable to me that when the user chooses the person they want to add, the person's job title automatically fills in a field.  However, I can't seem to be able to do that.  I created the Name field then when I went into the Show Field drop down, it had several options including telephone number, surname, job title.  I then selecvted which I wanted to show.  Is there a way to create another field that the user doesn't see that then is populated with the the job title, info which is otained from whatever name was selected?

Phew, sounds complicated, I know!

Also, In the picture field, I selected the field type as url/image, then selected show link as image.  But what I would prefer would be the option for the user to be able to browse the site, or their computer for the image file.  Currently, the user has to know the url for where the image is stored in a document library.

Any suggestions would be grateful

View Complete Post

More Related Resource Links

Custom user selection in Person or Group type column as per other list.

I have two list in the Sahrepoint Foundation 2010 site. 1) Projects with Title and members(Person or Group - multiple selection) 2) Tasks (Team site default)  - added lookup column Projects form the first list (required) Now I want to assign task given users in the projects list. ex. I have users A,B,C,D,E and Two Project P1 and P2 I have defined that P1 project has users A,B,C so task is distributed/assigned between this members, not to D and E I need some validation or lookup which restrict selection or D and E.   Thank you.  

SharePoint 2010 Custom List default overriding selection


We are finding that the second list using a field name from the first list that is defaulted does not take the field entry but uses the default when the record is created.  The First list field does take the change and populate the record.  We need the second list to accept the field change in creating a new record.

Populate fields from custom list..... Using Sharepoint Designer only



I have a custom list with all Active Directory user data in it......

(AD name / Email / Address / tel .... etc)


I then have a form that user can select their AD name, i want to populate the fields "Phone" + "Email"   etc....

from the custom list....


How do i do it ? using sharepoint designer only ??


Thanks Rob

Auto populate custom fields with values based on user selected in People Editor



I have a requirement wherein I want to populate the currently logged in user in people editor field of my custom web part and based on the user in people editor field, Also I should be able to select any other user if needed. I need to fill some other custom fields as well. I am able to get this quite easily. But suppose I remove the current logged user's name from people editor and enter some other name and then click on Check Names, then how do I change the custom fields based on the new user ?

    PeopleEditor peNameofFileRequestor = new PeopleEditor();
    TextBox txtPhoneNumber;
    TextBox txtDepartmentName;
    SPContext cnxtCurrent;

    protected override void CreateChildControls()

      cnxtCurrent = SPContext.Current;
      SPUser usrCurrent = cnxtCurrent.Web.CurrentUser;

      peNameofFileRequestor.MultiSelect = false;
      peNameofFileRequestor.SelectionSet = "User";
      peNameofFileRequestor.AutoPostBack = true;

      System.Collections.ArrayList entityArrayList = new System.Collections.ArrayList();
      PickerEntity entity = new PickerEntity();
      entity.Key = usrCurrent.LoginName;
      entity = peNameofFileRequestor.ValidateEntity(entity);

      Hashtable htEntityDa

Need to pass parameters from URL to fields in Custom List


I have a complex customized list and I need to pass parameters of two fields so that when the 'Questionnaire' is completed and subsequentially opened after initial submission, it will retrieve the Number and GUID automatically in respective fields. I send an email out with a link to the 'Form' that carries the parameters. I am trying to use the following javaScript but am unsure as to where to place this on the SharePoint page for it to work.



<script type="text/javascript">

function loadFormVars()
getQuerystring('CustodianGUID', 'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_ff46_1'); ///replace
customerGUID and form field name
'ctl00_m_g_d08916d8_7224_4665_be72_2de381f45985_FormField11_ctl00_ctl00_TextField'); ///replace customerGUID
and form field name

alert("it works");

function getQuerystring(key, field)
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var qs = regex.exec(window.location.href);
document.getElementById(field).value = qs[1];


Importing SharePoint List Data into Project Server 2007 Custom Fields

Learn how to use the programmability features of Project Server 2007 and Windows SharePoint Services 3.0 to import SharePoint list data into an enterprise custom field.

Move custom list (with lookup fields) to another Web Application

Is it possible to move a custom list with lookup fields to other custom lists from one web application to another? Creating list templates does not work and breaks the relationship. Thanks.   Neil

set the Report URL property to a specific report dynamically based on the selection in the list.

Hi I want to use  embedding the Report Viewer Web Part in a Web page, and I know we  should set the Report URL property to a specific report. but  is there a way by which we can set the url  dynamically based on the selection of the report  from  the list How can I customize this  feature Any Help on this is appreciated. Thanks

Multiple selection in connected list view webpart

Hi all, I have a webpart page with 2 listview webparts connected via  ("Send Row of Data"/"Get filter values from"). This connection permits me to select one row on the first listview (parent) and the second (child) gets filtered by the defined filter column. My question is how can I choose multiple rows on the parent so I can filter the rows of the child with multiple filter values? It seems on can only select one row via the "Select" column... Is there a workaround... Many thanks,  

DropdownList Selection to Populate TextBox

I have a dynamically generated dropdownlist, that lists e.g. Company Names. I want to be able to select a particular Company and display associated information e.g. Name, Address, City, State... etc. in text boxes adjacent to the list. I am trying to fire the following code from the dropdownlist "OnSelectedIndexChanged" property, but cannot 1) get the code to fire upon selection, and 2) populate the text boxes... any suggestions are appreciated!! Thanks CODE:     Public Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Facility.SelectedIndexChanged Dim FacilityAddressDetail As String  Dim FacilityAddress2 As String  Dim FacilityCity As String  Dim FacilityState As String  Dim FacilityZip As String Dim   FacilityAddressDetail = FacilityAddress2 = FacilityCity = FacilityState = FacilityZip =       mySettingsSIC = AppSettings   dgiSelectedIndexChange As DataGridItemFor Each dgiSelectedIndexChange In myDataGrid.ItemsCType(dgiSelectedIndexChange.FindControl("FacilityAddressDetail"), TextBox).TextCType(dgiSelectedIndexChange.FindControl("FacilityAddress2"), TextBox).TextCType(dgiSelectedIndexChange.FindControl("FacilityCity"), TextBox).TextCType(dgiSelectedIndexChange.FindControl("FacilityState"), TextBox).TextCType(dgiSelec

How to bind two different list to dropdown base on radiobutton selection

  I have radio button and dropdown column types in sharepoint list, and apart from this i have two list. I want to bind the data to data from the two list base on the selection of radio button. If i select 'Yes' i want to bind from the one of two list, and when i select i want to bind it to another list. Is it possible in sharepoint ?. If yes can you help me out in this

xml secondary data source used for drop down selection how do I return additional fields to form bas


I received some much needed assistance from this forum in the past. My current situation is that I have a xml data connection to a sharepoint list over an employee database that works fine. It allow me to connect to a view on the sharepoint list correctly and display the info which is a drop down on a last name field. I now need to be able to select a last name such as Doe and have other fields such as job code be populated on the form from the same sharepoing list I have already connected to. Any direction is greatly appreciated.



Infopath 2007 Multi Selection List Box

How can I limit the number of selections in the multi selection list box? For example, a customer can select up to 3 items, but if they try to select another item a dialog comes up to inform them only 3 can be selected.  The data source list is brought in via data connection from Sharepoint 2007.  In Infopath 2007, I have tried rules and data validation to do this and it does not work.  I have googled and found nothing.  Please submit steps or something that works.

I have loaded a cascading drop down list using Jquery. However my selection does not update the unde


I have 2 dropdownlists, the second (department) cascades from the first (division). I use a jquery script to update the second drop down list. When the user clicks submit, the underlying model is updated, apart from the new value for department. 2 ideas I have for fixing this are; a) Generate a postback. Prefer not to do this because of bad user experience. b) With a JQuery change event, make a call to server side and set a ViewData variable that I can use to update the field in the model later.

However there must be a better way. This is the view;

dynamic fields added/removed depending on user selection


Is it possible to dynamically add/remove fields upon creating an item in a list?

For example:
If user selects from drop down list and chooses "Booked"

and a date field name "Booked Date" will dynamically pop up underneath.

And if user selects a different choice, the date field will dissapear.

Can someone point me to anything that can be of help?

I searched around and noticed that this can be achieved via javascript using the ows.js object model?

Thank you for your help.

Multiple Selection List Box


Is the binding of Repeating Table to a Multiple Selection List Box, the only way to loop through the list box.  I have a number of list boxes (multiple selected) in my form and wold like to find out which ones have been selected.  The only posts I can find also use the Repeating Table.

Issue with People and Groups type of column in datasheet view of shrepoint list.


We have a list created in MOSS 2007 which has a column of type people and groups. When we open the list in datasheet view and try to add records for people and groups type of column the column shows only records from All People section of the site collection. I have verified this for another site collection within the same web application where I am able to see all the users though they are not in the All people section of site collection.
Could anyone please let me know if I am missing any setting or if there is any change required to see all the user names in the people and groups type of column in datasheet view.

Thanks ,
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend