Monthly Archives: December 2013

How to: Create and Deploy Workflow Actions in Sandboxed Solutions

http://msdn.microsoft.com/en-us/library/gg615449.aspx However, the code in this article is wrong. Use the following instead: In <RuleDesigner>: <FieldBind Id=”4″ Field=”ListID” DesignerType=”ParameterNames” Text=”ID of new list”/>. In <Parameters>: <Parameter Name=”ListID” Type=”System.String, mscorlib” Direction=”Out” DesignerType=”ParameterNames” /> Video demo: http://msdn.microsoft.com/en-us/office365trainingcourse_3v_3.aspx Advertisements

Posted in SharePoint 2010, SharePoint Designer 2010, Visual Studio 2010 | Leave a comment

SharePoint: CAML Query Joins and Projections

Referenc (by Nadeem Yousuf): http://sharepointnadeem.blogspot.com.au/2013/08/caml-query-joins-and-projections.html Scenario: A user asked a question, can I still perform CAML query joins even if I don’t connect Lookup to ID of another list. I want to connect Lookup to the Title field of the … Continue reading

Posted in CAML, SharePoint 2010, Visual Studio 2010 | Leave a comment

CAML Query that filters against a Lookup Column

Standard what (based on value): 1 2 3 4 5 6 <Where>     <Eq>         <FieldRef Name=”Category” />         <Value Type=”Lookup”>My category</Value>     </Eq> </Where> By ID: 1 2 3 4 5 6 <Where>     <Eq>         <FieldRef Name=”Category” LookupId=”TRUE” />         <Value Type=”Lookup”>234</Value>     </Eq> </Where>

Posted in CAML, SharePoint 2010, Visual Studio 2010 | Leave a comment

A CAML Query Quick Reference

The info below was from this link: http://joshmccarty.com/2012/06/a-caml-query-quick-reference/ Single Line of Text Value Type Text Example <Query><Where><Eq><FieldRef Name=”Title” /><Value Type=”Text”>Hello World!</Value></Eq></Where></Query> Notes This is one of the simplest queries. The example selects items with a title equal to “Hello World!” … Continue reading

Posted in CAML, SharePoint 2010, Visual Studio 2010 | Leave a comment

Query Large List in SharePoint

using (SPSite currentSite = new SPSite(SPContext.Current.Site.ID)) { using (SPWeb currentWeb = currentSite.OpenWeb(“crm”)) { SPList myList_TrainingRecords = currentWeb.Lists[“Training Records”]; SPQuery qry = new SPQuery(); qry.Query = “<OrderBy Override=\”TRUE\”>” + “<FieldRef Name=\”Title\” Ascending = \”true\” /></OrderBy>”; // Note: if the field name … Continue reading

Posted in SharePoint 2010, Visual Studio 2010 | Leave a comment

OrderBy Element (Query)

http://msdn.microsoft.com/en-us/library/office/ms467378.aspx <OrderBy Override = “TRUE” | “FALSE” UseIndexForOrderBy = “TRUE” | “FALSE”> <FieldRef Ascending = “TRUE” | “FALSE” Name = “Text” /> … </OrderBy> The following example sorts the fields first in ascending order by the Newcomers field, then in … Continue reading

Posted in Visual Studio 2010 | Leave a comment

Get tasks by User’s Name

string assignedToName = assignedTo.Substring(assignedTo.IndexOf(“#”) + 1); if (assignedToName.ToUpper().Contains(userDisplayName.ToUpper())) { isForCurrentUser = true; } else { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite siteCollection = new SPSite(SPContext.Current.Site.ID)) { using (SPWeb myWeb = siteCollection.OpenWeb(“Departments”)) { SPWebCollection mWebs = myWeb.Webs; SPWeb currentWeb2 = mWebs[“Admin”]; SPGroupCollection spGroupCollection … Continue reading

Posted in SharePoint 2010, Visual Studio 2010 | Leave a comment