Link to home
Start Free TrialLog in
Avatar of Cleartrack
CleartrackFlag for United States of America

asked on

Sharepoint Lookup or Calculation

I have two WSS 3.0 lists: one called Issues and a second called Client Table.  In the Issues list, I have a column called Client which stores a company name like "Acme".  In the Client Table list, I have a column called Client and another with the associated Username.  Assuming a 1-to-1 relationship & without doing a lot of coding, is it possible to return the Username to a new column in the Issues list from the Client Table list based on the value of the Client column in the Issues list?  If so, how would I do this?
Avatar of amolghanwat
amolghanwat
Flag of India image

Well, I tried this with content types and using site columns. This does not look possible using OOB site column functionality.

You can either go with the following approaches:
- Make the new column (where you need to pull the user from the Client Table list) and the clients column in the Issue list as lookup columns to pull the user from the Client Table list.
Modify the NewForm.aspx page in the Issue list to have custom javascript to automatically select the username when the user selects the Client from the drp down.

This looks like the simplest way to get this done. But it does require customization.

Another way will be add an event handler to the list.
The event handler should be using ItemAdded method of the SPItemEventReciever class
_http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spitemeventreceiver.itemadded.aspx

and in this method, you can add your functionality to collect the data from the Client Table list and match it with the one the user has filled.

You mentioned that there is 1-2 relationship, but using OOB columns, SharePoint is not that intelligent to detect it. Thus, custom event handler needs to be created to have that 1-1 relationship addressed.
ASKER CERTIFIED SOLUTION
Avatar of Joestetz
Joestetz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial