How to filter lookup column in sharepoint 2010
Hi,
I have three list, Designation, Employee & Client respectively. Designation have one column as Designation having values like director,hr,etc. The designation column is lookup in employee list in which other columns are empName, empAddress
etc. Now in my client list there is Client name field & another fields are director & hr. So now i wanted to filter all those employees having designation director & hr from employee list to my client list's director & hr field respectively.
so how can i achieve this?
Take a look at this codeplex project:
http://filteredlookup.codeplex.com/
Or via this way (SharePoint Designer - Datasource:
http://sharepointbergen.blogspot.com/2007/04/creating-filtered-lookup-fields-in.html
Regards, Marijn Somers|| http://www.beyond-it.be || Twitter: http://twitter.com/marijnsomers || http://marijnsomers.blogspot.com
Similar Messages
-
Hi All,
I have list with some Lookup columns like City, Pin, and Text Column Name. All these are required columns.
Now I want to prevent duplicates while submitting InfoPath form if a Combination of City,Pin & Name. (like a Composite primary in Database is used.)
Can some one help me on how to achieve this using InfoPath 2010 Rules, writing rule in Xpath.
Thanks in Advance.1. Add a secondary data connection to the list where the form will be submitted.
2. Prior to submit via rules, set the query fields in the above connection: City, Pin & Name with values entered in the form. Query the data source and check if the result has values.
3. Show error messages accordingly if exists else continue with Submit.
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom. -
How to have repeating columns for SharePoint list
Hi
I am working on SharePoint 2013 environment and trying to customize a SharePoint list using infopath form.
Have a list called "Future Actions" and users need to submit their actions. An user can submit
n number of Planned actions and every user will submit different number of actions.
Columns:
1. Title TEXT
2. Month Choice
3. Planned Actions TEXT
I want to capture user's actions in the same form, such that he would have option to expand the
Planned actions column to add n number of Actions.
Simply, For one Month, user should be able to define all actions in one form. and the number of planned actions will vary from user to user.
Pls suggestHi,
The OOTB can't provide a feature to meet your requirement.
Here is a similar thread for your reference:
http://social.msdn.microsoft.com/Forums/en-US/e475cc7f-435f-4e6e-b579-c74311d67b4e/creating-repeating-columns-in-sharepoint-2010-list
In SharePoint 2013, we can also customize a special field type using client-side rendering.
http://msdn.microsoft.com/en-us/library/office/jj220061(v=office.15).aspx
Best Regards
Dennis Guo
TechNet Community Support -
How to block specific DL in SharePoint 2010 application.
Hi All,
We have SharePoint 2010 farm. I have a requirement to block specific Distribution List which should not recognized when user trying to give access at (user.aspx page)site level.
How can i restrict this in SharePoint 2010 farm.
Regards
S. ManiYou can use content editor webpart to run javascript. Java script will redirect users from accessing the site. You need t o specify the user Id; it wont work on DL
Blow is the java script:
==================Script Start ===============
ExecuteOrDelayUntilScriptLoaded(getWebUserData, "sp.js");
var context = null;
var web = null;
var currentUser = null;
function getWebUserData() {
context = new SP.ClientContext.get_current();
web = context.get_web();
currentUser = web.get_currentUser();
currentUser.retrieve();
context.load(web);
context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
function onSuccessMethod(sender, args) {
var userObject = web.get_currentUser();
if (userObject.get_loginName() == 'i:0#.w|domain\userid')
window.location="/businesses/pulpandfibre";
function onFailureMethod(sender, args) {
alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
=============Script End=============== -
How to change format of OOB columns in sharepoint 2010?
Hi,
I have an requirement of changing of date format from 12/05/2014 to 12 May 2014 in a list for 2 Out of Box columns: Created , Modified. Can some one please help me on this.
Please find the screenshot in which columns are highlighted:
BadriHi,
Please check below:
http://social.technet.microsoft.com/Forums/sharepoint/en-US/ade1b4a2-7eac-479a-9dde-baa66eb18e36/how-to-change-date-format-of-sharepoint-list
http://www.sharepointusecases.com/2009/01/customizing-datetime-format-on-a-list-view-web-part/
Hope it helps!
Thanks,
Avni Bhatt -
Setting default value for lookup column in Sharepoint 2013 via powershell
Hi,
when I try to use the 2010 version of setting a default value to a lookup column ( colum.defaultvalue="1;#Open"), this is not longer supported in SharePoint 2013. The defaultvalue is always the alphabetically sorted first entry in the source
list.
How can I change this?
Thanks for any help.
LutzHi Lutz,
You can set the default value of a look-up column. The code is very simple, just need to take care of the code below.
$w = Get-SPWeb http://web
$l = $w.Lists["MyDocumentLibrary"]
$lf = $l.Fields["lookupColumn"]
$i = $l.Items[0] #List item to update
$lf.ParseAndSetValue($i,"1;#lookupvalue") #1;#lookupvalue refers to the ID of the lookup item and the value of the lookup item.
$i.Update()
As another example, if I wanted to update all the items in my document library that had the lookup value
Pending, with the lookup value Complete;
$w = Get-SPWeb http://myweb
$l = $w.Lists["MyDocumentLibrary"]
$lf = $l.Fields["lookupColumn"]
foreach($i in $l.Items)
if($i["lookupColumn"] -eq "1;#Pending")
$lf.ParseAndSetValue($i,"2;#Complete")
$i.Update()
Indul Hassan
Microsoft Community Contributor
http://www.indulhassan.com
You Snooze.. You Lose !! -
Lookup column in sharepoint list column in visual studio
Hi i have a list with two columns as student id and student name. in second list am
taking one column as lookup and am giving reference to student name. but while inserting record in second list when am selecting student name and clicked save ,in second list i have to save student id not student name. (just like dropdown in asp.net data text
field and data value field.) how can i achive this in sharepoint using lookup column and am creating the second list in visual studio.you need to create a look up column on Name field in second list and a second look up column on the same field.
then hide and show your fields in edit and display form based on your requirements .
<Field
ID="{886AF390-F68A-4B8A-9EC4-12108A11CC99}"
Name="StudentName"
DisplayName="StudentName"
Type="Lookup"
List="Lists/Students"
ShowField="StudentName"
PrependId="TRUE"
Group="test">
</Field>
<Field
ID="{599F97C5-564C-4DE5-BE4D-3A49DDC87FB5}"
FieldRef="{886AF390-F68A-4B8A-9EC4-12108A11CC99}"
Name="StudentId"
DisplayName="StudentName:Trainer StudentId"
Type="Lookup"
Required="FALSE"
ShowField="StudentId"
List="Lists/Students"
Group="test">
</Field> -
How to Archive a list in sharepoint 2010
Hi
I think large list is the inevitable trend and will be a very common issue faced by everyone. We are a medium business using sharepoint 2010.
For past 3 years, one of our SharePoint lists is over 20000 items.
From my end:
1. I have indexed some important columns and created filtered views but it does not help much.
2. I have increased the list threshold value to 25000( Even though the best practice is 5000).
3. Also, I have set the list template size to 500MB
4. When I try to save the list as a template, SharePoint throws an exception error.
5. I tried working on the code
mentioned in the link
below but it looks complicated for me.
http://spboom.com/sharepoint-development/moving-sharepoint-list-items-to-archive-list/
What I need:
I need to archive old items in the list. After archiving, I might need to refer to the archived items from time to time.
As I'm newbie to SharePoint, it would be great, if someone can elaborate in detail with what can be done.
Again your help in this is much appreciated.
Thanks & Regards,
SweRWhat vesion of SharePoint are you using? If you want to move items across from one list to another (as per your prefered option), something like: -
Create a list template of you list with no content
Recreate it on the same level as the main lis
Create an SPD workflowthat'll copy an item to the new list and delete the original. Make sure it doesn't have a triggering action
Use an Expiration Information Rights Policy to triger the workflow.
Please note that this won't preserve the original author / create metadata as Alex has already said.
Cheers,
Steven Andrews
SharePoint Business Analyst
Blog:
Steve's SharePoint Space Twitter:
LinkedIn:
Facebook:
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
How to design SSRS report using SharePoint 2010 List Version History
Hello,
I am using Sharepoint 2010 list, i need to design SSRS report using Sharepoint List Version History. Could please let me know how to design.
Thank you.
Kind RegardsYou could do that with SQL Server Reporting Services, Please follow the instructions from the link below:
http://www.mssqltips.com/sqlservertip/2068/using-a-sharepoint-list-as-a-data-source-in-sql-server-reporting-services-2008-r2/
Hope that would work fro you.
Please Mark as Answer, if the post works for you.
Cheers,
Amar Deep Singh -
How to make sub sites in SharePoint 2010 as Read Only
Hello,
We have a requirement to make sub site as read only in SharePoint 2010 programmatically.
How we can achieve it using Server Object Model ?
Thanks,
HatimHi,
You can write a WinForm program, and use
SPSecurableObject.BreakRoleInheritance method to achieve your requirement.
More information for your reference:
http://fangdahai.blogspot.com/2012/09/how-to-set-sub-site-in-read-only-mode.html
https://social.msdn.microsoft.com/Forums/en-US/1f836da6-88ea-4d88-9e43-3383d139ca01/what-is-the-idea-of-stop-inheriting-permission-from-parent-site?forum=sharepointdevelopment
Best Regards
Dennis Guo
TechNet Community Support -
How to Create Custom List in SharePoint 2010 Programmatically ?
Hi,
i have tried the following way,
http://devendra-sharepoint.blogspot.in/2012/01/creating-list-programatically-in_30.html
But i am not able to create list.
Becuase i am getting the following error.
'Microsoft.SharePoint.SPWeb' does not contain a definition for 'EnsureList' and no extension method 'EnsureList' accepting a first argument of type 'Microsoft.SharePoint.SPWeb' could be found (are you missing a using directive or an assembly reference?)
Please advice.
Thanks,
AasaiHi,
You can use list.Fields.Add() to add column in list. See below blog:
http://www.c-sharpcorner.com/blogs/3764/create-sharepoint-list-programmatically.aspx
Use this to delete list:
http://www.c-sharpcorner.com/UploadFile/54db21/delete-list-in-sharepoint-2010-programmatically-using-vs-201/
See this for remove user/group from list:
http://www.c-sharpcorner.com/UploadFile/54db21/remove-group-permission-to-list-in-sharepoint-2010-programma/
Hope it could help
Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer -
Setting the default value to taxonomy column in sharepoint 2010 using client object model
I am creating a metadata column and I want to set its default value in sharepoint 2010 using client object model. Can anyone help me?
My code for creating metadata column is as below:
ClientContext clientContext = new ClientContext(siteUrl);
Web site = clientContext.Web;
List list = site.Lists.GetByTitle("LibraryName");
FieldCollection collField = list.Fields;
string fieldSchema = "<Field Type='TaxonomyFieldType' DisplayName='SoftwareColumn' Name='SoftwareColumn' />";
collField.AddFieldAsXml(fieldSchema, true, AddFieldOptions.DefaultValue);
//oneField.DefaultValue = "ASP.NET|4c984b91-b308-4884-b1f1-aee5d7ed58b2"; // wssId[0].ToString() + ";#" + term.Name + "|" + term.Id.ToString().ToLower();
clientContext.Load(collField);
clientContext.ExecuteQuery();Hi,
Please try the code like this:
ClientContext clientContext = new ClientContext("http://yoursite/");
List list = clientContext.Web.Lists.GetByTitle("List1_mmsfield");
clientContext.Load(list);
clientContext.ExecuteQuery();
FieldCollection fields = list.Fields;
clientContext.Load(fields);
clientContext.ExecuteQuery();
Field f = fields.GetByTitle("mms");
clientContext.Load(f);
clientContext.ExecuteQuery();
Console.WriteLine(f.Title + "---" + f.DefaultValue);
//2;#A2|a0a95267-b758-4e4d-8c39-067069fd2eef
//1;#A1|641f5726-992c-41c8-9ddc-204a60b88584
f.DefaultValue = "1;#A1|641f5726-992c-41c8-9ddc-204a60b88584";
f.Update();
clientContext.Load(f);
clientContext.ExecuteQuery();
Console.WriteLine(f.Title + "---" + f.DefaultValue);
Best regards
Patrick Liang
TechNet Community Support -
How to Filter Lookup Field Values by Current User in Caml Query
sharadpatil
Hi,
If you want to use JavaScript, we can use SPServices to achieve it.
/* Get Current username */
var userName = $().SPServices.SPGetCurrentUser({ fieldName: "Title" });
/* Get Sites assigned to current user */
var query = "<Query><Where><contains><FieldRef Name='UserName' /><Value Type='User'>" +
userName + "</Value></contains></Where></Query>";
More information is here:
SharePoint – Filter Lookup Field Values by Current User
http://ljayaprakash.wordpress.com/2012/06/01/filter-lookup-field-values-by-current-user/
Best Regards
Dennis Guo
TechNet Community Support -
Batch Operation for LookUp Column in SharePoint
Hi
I am trying insert bulk data into list.
For that I am using Batch Process .But the problem i am facing is if the column of type is "LookUp" I am not able to apply batch
Can you please help me like "What is the column format in Batch Operation for "LookUp column.
Thanks
SiddarthaHi Siddartha,
The structure of the look column is id;#Value, so you can set the lookup column like this:
<Method ID='2' Cmd='New'><Field Name='CustomerID'>1;#Cust_1</Field></Method>.
You can refer to the link below:
http://dotnetstep.blogspot.in/2009/01/batch-update-in-sharepoint.html
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
Users are unable to expand a list when a filter is applied in SharePoint 2010 site
There are set of users facing issues while filtering the contents in the SP2010 site since the migration to SharePoint 2010. It is no longer possible to expand a list when a filter is applied.
When open a fresh browser the filter does work, but if we perform an edit or save in the list, the filtering option disappears for the entire site.
Then we need to forcefully close all the active browsers and start a new browser to see the list. Have checked with different browsers and different machines ended up with the same issue. Could you please suggest a workaround for the problem? Thank you.Check if On alternate access mappings might be causing this issue
Maybe you are looking for
-
My old computer crashed. Trying to recover music from iPod. Can transfer music, but not song titles. Titles appear in 4letter mpg formats. What am I doing wrong?
-
Why is it takes Apple forever to fix the appleeventsd bug?
There are hundreds of posts around the net about killing appleeventsd to fix the issue that prevents "open in finder" and it's been like that for months now... Why is it takes Apple forever to release a fix? Everybody's laughing at Microsoft's update
-
Stolen pc - how do I stop it synching & updating info from phone/iPad
I have had my lap top stolen, how can I remotely deauthorise, or stop the laptop automatically synchronising. I have iPhone and iPad to do this now? Is simply changing my password enough or is there something else I can do? I am concerned my personal
-
Not 100 percent sure, but I believe my colleague has tried them all - 5+ day lead time
-
Transparency and colour question
Hello - I would like to mix colour in Flash using transparency to create something like this (no interactivity required): If I create Cyan, Magenta and Yellow movie clips and change the Alpha transparency, obviously the whole colour becomes lighter (