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


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

create a sharepoint view using caml where a multiuser filed is filtered by current user

Posted By:      Posted Date: November 02, 2010    Points: 0   Category :SharePoint
 

Hi

I am using SharePoint Foundation 2010

I have a list with a person filed (set to allow multi users) called UserContacts

I want a vew that displays only list items where the current user is one of the entries in the UserContacts field.

How can this be done. I would like to do this in CAML as i am doing this programatically.

Help is REALY appreciated

Mark




View Complete Post


More Related Resource Links

create current user filter in sharepoint designer or wss3

  
hi, how can i create a current user filter in sharepoint designer?

How to get Email of Current User Data View Web Part Sharepoint 2010 and pass to WebService data sour

  
I have to pass in the email address of the current user to a web service data source (run time) of a Data View Web Part.

My Question is:

a) How can I get Email address of current user based  in DVWP.
I know we can get the CurrentUser using the CurrentUserName but how do we get the Email for the Current User.

b) After getting the Email how do we pass to the Web Service.


Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

  
Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

How to create scrolling table for columns in a SharePoint Designer Data View

  

I have a fairly complex SharePoint Designer 2007 Data View they have added two more requirements.

1. Have the columns on the right side be able to scroll left to right as there is a large number of columns, while the first 3 columns on the left side stay locked in place.  This is only one list not two, and because of some other requirements I have it must remain to be just one list.

2. Then they also need to have scrolling up and down of the entire list with the headers locked in place.

The first requirement is more important than the second, but preferrably I need to do both.

I am new to XSL so not familar with the syntax. Is this something I can do on a custom Data View? Does anyone have any examples of how?

I have a drawing that show how it needs to look but I don't see an option here to upload a graphic.

So here is a link to my graphic example uploaded to my blog area: http://lindachapman.blogspot.com/  or just the image here: http://4.bp.blogspot.com/_aB01ue__NvQ/TGL42MOvrGI/AAAAAAAAAA4/c3xP4uCy4BU/s1600/Scrolling.png

I failed to mention that 3/4 of the columns are HTML Calculated fields wh

How to get "Current Date" on SharePoint Designer for Invoice Ageing Data View Report??

  
Hi Experts, I would like to know how can i get/show "Current Date" in SharePoint Designer ?? Any good tutorial ? FYI, I need this "Current Date" for my Ageing Data View Report, Purpose To offset with "Invoice Receive Date" to get total days of payment payable for the invoice. Please assists, Thanks

How to pass current user's login name as parameter to a RDL . (SSRS integration with sharepoint)

  
I have a webmethod which has two parameters. One is for year and another is for Currently logged in user. I call this method in RDL file. From RDL File how can we pass Currently logged in user's login name? I tried  with USER!UserID. It is passing the USERID but i need to pass the login name(SPWEB.currentuser.loginname)  

How to create a list filter like: get all list elements from the current user and all employees from

  
Hello, is it possible to filter elements by the condition mentioned in the title? Tobias

How to create a custom view in SharePoint 2010?

  
I can't find a good answer for this with the 15 minutes of searching I have done. Makes me think that there might be some roadblocks here.  I want to create a custom view for a list in sharepoint. Basically, I want to conditionally apply some custom table row formatting based on a value of a column in that row  conditionally add an image along with a text in a column (again based on a column value) I am thinking that a custom view is the way to go...any direction on this? maybe a link to a good example? Thanks, Jake.

how to get current logged in user in sharepoint

  
hi im trying to get current logged in user from sharepoint site. All im getting is domain/administrator. I tried following. SPUser and delegation with elevated privilege. they are also not working for me. following is the code im working. spsite site = new spsite("some site")  spweb web = site.openweb() then im using spuser object to get the user. i went to the following link but it seems that guy was also not able to do this.... http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/4101e616-db5d-4504-ad16-169ff62269fb/   any idea... thanks Aqi

How to Create a Tab View in sharepoint page

  
Hi All, I want to create 5 tabs in sharepoint page please tell me how can I do that and what controls I must use? see the sample example here: http://www.transport.govt.nz/   thanking you

How to get current user in an action of a workflow (without .NET coding) in SharePoint Designer

  

Does somebody know how to get current user (logon user) in an action of a workflow definition from the Sharepoint Designer 2007. I know how to do it by using .NET coding, but it requires to upload a dll to the bin directory of the application which is not an option due to my company Sharepoint policies.


Anonymous user to comment on post, does not allow anonymous user to view pending post SharePoint 201

  

I have created a Blog site using SharePoint Foundation 2010 , I made allow anonymous access to this site 

and i also made anonymous user to Comment on the Post and View the comment for the Post .  

http://<server_name>/Blog/Default.aspx  this is the default Page were we can see all the Post ..

When i Click on the Comment http://<server_name>/Blog/Lists/Posts/Post.aspx?ID=1 i am redirected to this page 

I have also allowed content approval for the Comment Submitted by the anonymous user 

but the Problem is that Anonymous user can see all the Comment for that particular post before approved.

Please help for this...


Sharepoint Foundation - Create and deploy custom edit/view forms for external lists

  

Firstly, we are using sharepoint foundation so Infopath forms are not an option for us.

We have a Visual Studio sharepoint project which deploys a complete sharepoint site. The site contains a number of external lists and we want to be able to create customised view/edit forms for these lists and add them to our Visual Studio project so they can be deployed as part of the new site. The idea is that we can deploy the solution to a fresh site with a default set of forms which can then be customised for different implementations of the site.

Here's the steps we have been using to try and do this:

1. Deploy the base project (BDC) to the sharepoint site

2. Create external lists based on the BDC content types

3. Use Sharepoint Designer to create new edit/view forms for the lists and set these as the default forms for the list

3. Save the site as a template

4. Import the template into a new Visual Studio project and select the lists we require. This gives us a List Definition, a pages module (with element file), an elements file and a schema file (both for the List Instance).

5. We then add the contents of the imported project to our main solution as follows:

  • Create a new List Definition (including List Instance)
  • Copy the contents of the imported Elements.xml to the Elements file for our List Instance.

How can I filter a Sharepoint 2007 libarry list based on current user login?

  

Hi all.

I would like to know how I can filter a SharePoint library list based on current user login.

Suppose I have created the followings:

1) A SharePoint form library containing bunch of uploaded InfoPath form data.

2) The InfoPath form template contains a promoted text field called "TargetUser" to store user domain login (ex: DOMAIN\JOE) and every InfoPath form file in the library has a valid domain name stored in the "TargetUser" field.

I have created a custom view for the form library and would like to filter this view so only items whose "TargetUser" field matches current user's login ID are displayed.

I went to Edit View page to customize the view and tried to use the [Me] function but I got a "Filter value is not a valid text string" message instead when clicking OK. Apparently [Me] returns a Person/Group data type and the filter cannot compare its value to that of "TargetUser".

I tried using text functions (ex: TEXT([Me],"") hoping to extract default string value from [Me]. The filter accepts the parameter without any error but the resulting fitlered list does not display any items at all.

I have googled this subject for hours but I have not found any solution.

It would be greatly appreciated if anyone can help me t

Can a Calendar view be filtered dynamically from a user selection?

  

We have a list of project risks where each item (i.e. Risk) is associated with one and only one project, each item also has a proximity date (i.e. roughly when we expect the risk to hit).  We have been asked to product a report page with a calendar view showing the risks against their proximity date with a dynamic filter that will let management select which project they want to view risks for.


Were this just a normal list view, no problem.  Just convert the list view to an XSLT DVWP in SharePoint Designer (or create the DVWP from scratch), drop a datasource and drop down box on the page and feed the selection into the filter on the view.  Job done.  Unfortunately it appears that you cannot convert a calendar to an XSLT DVWP, the option is missing from the menu in SPD, and we cannot find a way to create a Calendar DVWP from scratch.

Is there a way to either convert a Calendar view to  a DVWP?  Failing that, is it feasible to create a Calendar DVWP from scratch?  If so can you suggest any resources that would guide us as to how?

We've tried searching the web but to no avail.

We're running Sharepoint 2007 (WSS 3.0), no MOSS , and using SPD 2007.  We do not have Visual Studio and cannot add third party tools/addons.  Client side we're stuck with Windows XP and IE 6.

&

Fine-grained User Permissions, create and view with restricted edit rights

  

I'm running a Sharepoint 2007 installation which is slowly being rolled out through the organisation. We have a group of calendars which are shared between 14 executive PAs. I've been asked to lock down the permissions so that whilst any of the users can add items, only the user who created the item can subsequently edit this. I thought I could handle this by creating a new permission level with create and view rights only, which does what it should, however the user can now no longer edit their own appointments either.

Is there a way that I can give the item creator specific permissions on their item by default?


how to get current logged in user for sharepoint site

  

Hi ,

im not able to get the current logged in user for sharepoint site.

for example--if i logged in with "abc" in my system and  logged in with "pqr" on sharepoint site.
then "oWeb.CurrentUser " return the "abc" .
 but as per me..i want pqr--bez im logged in to share point site with "pqr" user.


Categories: 
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