2

I have one document library. And a workflow attached to it, when this workflow is executed a task gets created which is assigned to users.

I want to have a view which shows the tasks that are assigned to current logged in user.

And I strictly need this from code behind.

Is it possible with event receiver code in the feature and how ?

Reference-http://sarangasl.blogspot.in/2009/12/create-sharepoint-list-view.html

2 Answers 2

2

Event receiver is not a choice for this. If you are sure about the Task List name and strictly want to do this with Code Behind.

Then I think you should develop a Visual WebPart which queries the task list with a filter of Current User, and all the items.

You can read Walkthrough: Creating a Web Part for SharePoint

2
  • 1
    Hello Asad, I'd used the CAML Query for the same- <Or> <Membership Type=\"CurrentUserGroups\"> <FieldRef Name=\"AssignedTo\"/> </Membership> <Eq> <FieldRef Name=\"AssignedTo\"></FieldRef> <Value Type=\"Integer\"> <UserID/> </Value> </Eq> </Or> Reference- msdn.microsoft.com/en-us/library/office/… It's working fine. So can you please let me know why the Event receiver is not a choice for this ?
    – Ram
    Commented Nov 25, 2015 at 11:38
  • This looks good. You will need to you use in Visual Webpart.
    – Asad Refai
    Commented Nov 25, 2015 at 11:41
1

With the help of this CAML Query we can do the same- https://msdn.microsoft.com/en-us/library/office/aa544234(v=office.15).aspx

2
  • 1
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. - From Review
    – Waqas Sarwar MVP
    Commented Nov 26, 2015 at 6:10
  • Ohh, See this comment for the same. <Or> <Membership Type=\"CurrentUserGroups\"> <FieldRef Name=\"AssignedTo\"/> </Membership> <Eq> <FieldRef Name=\"AssignedTo\"></FieldRef> <Value Type=\"Integer\"> <UserID/> </Value> </Eq> </Or>
    – Ram
    Commented Dec 3, 2015 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.