Note: You are viewing an old version of this snippet. View Latest Version

Active Tasks (Get Items By View) using SharePoint Data Zoom Web Part Atom Feed

In Brief Get the tasks using the "Active Tasks" view.
# 's
 1## Get the tasks list
2
3#set( $tasksList = $web.lists.get_item("Tasks") )
4
5
6
7## Get edit url information
8
9#set( $sourceUrlEncoded = $HttpUtility.UrlEncode($request.RawUrl) )
10
11#set( $editForm = $tasksList.Forms.get_item($PAGETYPE_PAGE_EDITFORM) )
12
13
14
15## Get the items in the 'Active Tasks' view
16
17#set( $activeTasksView = $tasksList.Views.get_item("Active Tasks") )
18
19#set( $activeTasksItems = $tasksList.GetItems($activeTasksView) )
20
21
22
23#foreach($item in $activeTasksItems)
24
25 #beforeall
26
27 <table class="ms-listviewtable" cellpadding="3" cellspacing="0" border="0" width="100%">
28
29 <tr class="ms-viewheadertr">
30
31 <th class="ms-vh2-nofilter">Title</th>
32
33 <th class="ms-vh2-nofilter">Status</th>
34
35 <th class="ms-vh2-nofilter">Priority</th>
36
37 </tr>
38
39 #odd
40
41 <tr class="">
42
43 #even
44
45 <tr class="ms-alternating">
46
47 #each
48
49 <td class="ms-vb2"><a href="$web.Url/$editForm.Url?ID=$item.ID&Source=$sourceUrlEncoded">$item.get_item("LinkTitle")</a></td>
50
51 <td class="ms-vb2">$item.get_item("Status")</td>
52
53 <td class="ms-vb2">$item.get_item("Priority")</td>
54
55 #after
56
57 </tr>
58
59 #afterall
60
61 </table>
62
63 #nodata
64
65 No tasks found
66
67#end

Get the tasks using the "Active Tasks" view.