SharePoint Learning Kit Macros for Assignment List Web Part

29 January, 2015 · 1 minute to read

SharePoint Learning Kit Macros for Assignment List Web Part

The queries in the Assignment List Web Part support macros in the conditions, e.g. here is the Due This Week Instructor query

 

<Query Name="DueThisWeekInstructor" Title="$Resources:SlkDll,QueryTitleDueThisWeek" ViewName="AssignmentListForInstructors" CountViewColumnName="AssignmentId"> 
  <Column Title="$Resources:SlkDll,QueryColumnTitleSite" RenderAs="SPWebName" ViewColumnName="AssignmentSPWebGuid" ViewColumnName2="AssignmentSPSiteGuid" /> 
  <Column Title="$Resources:SlkDll,QueryColumnTitleAssignment" RenderAs="Link" ViewColumnName="AssignmentTitle" ViewColumnName2="AssignmentId" NullDisplayString="$Resources:SlkDll,QueryColumnNullDisplayUntitled" /> 
  <Column Title="$Resources:SlkDll,QueryColumnTitleDue" RenderAs="UtcAsLocalDateTime" ViewColumnName="AssignmentDueDate" CellFormat="d" NullDisplayString="$Resources:SlkDll,QueryColumnNullDisplayDash" ToolTipFormat="$Resources:SlkDll,QueryColumnToolTipDue" Wrap="false" /> 
  <Column Title="$Resources:SlkDll,QueryColumnTitleSubmitted" RenderAs="Submitted" ViewColumnName="CountCompletedOrFinal" ViewColumnName2="CountTotal" Wrap="false" /> 
  <Condition ViewColumnName="AssignmentSPWebGuid" Operator="Equal" MacroName="SPWebScope" NoConditionOnNull="true" /> 
  <Condition ViewColumnName="AssignmentDueDate" Operator="IsNotNull" /> 
  <Condition ViewColumnName="AssignmentDueDate" Operator="GreaterThanEqual" MacroName="StartOfThisWeek"/> 
  <Condition ViewColumnName="AssignmentDueDate" Operator="LessThan" MacroName="StartOfNextWeek"/> 
  <Sort ViewColumnName="AssignmentDueDate" Ascending="true"/> 
  <Sort ViewColumnName="AssignmentTitle" Ascending="true"/> 
</Query>

The list of macros is:

NameTypeDescription
SPWebScopeArray of site IDs.The ID of the sites that the ALWP is limited to depending on its properties: Will be the current site, null (for all) or an array of IDs.
CurrentUserKeyGuid stringThe key of the current user in the SlkUser table. Not generally needed as the views are normally limited to current user.
NowDateTimeThe current date and time
StartOfTodayDateTimeMidnight of today
StartOfTomorrowDateTimeMidnight of tomorrow
StartOfThisWeekDateTimeMidnight of the start of the week as defined by the current user’s culture.
StartOfNextWeekDateTimeSimilar to StartOfThisWeek, but the subsequent week.
StartOfWeekAfterNextDateTimeSimilar to StartOfNextWeek, but the subsequent week.

 

As of version 1.8, you can now add a day modifier to the DateTime macros, to give you more flexibility over the date ranges. The format is:

macroName:dayModifier

Where macroName is the name of the macro above, and dayModifier is an integer value of days to add to the normal value. This can be negative to take away days. So if you wanted a query for assignemnts due tomorrow, you could have

<Condition ViewColumnName="AssignmentDueDate" Operator="GreaterThanEqual" MacroName="StartOfToday:1"/> 
  <Condition ViewColumnName="AssignmentDueDate" Operator="LessThan" MacroName="StartOfToday:2"/>

Richard Willis headshot

Written by Richard Willis

Managing Director / Founder

Richard started SalamanderSoft in 2007 after a successful career as a software developer. Wanting to start his own company and with experience in integrating school systems he set out to build the best integration system for schools and to exceed customer expectations. He starting out on his own, doing all the coding, support and sales until finally the growing number of customers meant he needed to start growing the team. He is still heavily involved in coding the core Integration Suite product in addition to running the company and being the first point of contact for prospective customers.

Copyright © 2020 SalamanderSoft Limited