Search This Blog

Total Pageviews

Monday, October 31, 2011

Joins in SharePoint COM

private void GetParts(string searchSku)
  List partsList = clientContext.Web.Lists.GetByTitle("Parts");
  List inventoryLocationsList = 
    clientContext.Web.Lists.GetByTitle("Inventory Locations");

  CamlQuery camlQueryPartsList = new CamlQuery();
  camlQueryPartsList.ViewXml =
              <FieldRef Name='SKU' />
              <Value Type='Text'>" + searchSku + @"</Value>

  CamlQuery camlQueryInvLocationList = new CamlQuery();
  camlQueryInvLocationList.ViewXml = 
              <FieldRef Name='PartLookupSKU' />
              <Value Type='Lookup'>" + searchSku + @"</Value>
          <OrderBy Override='TRUE'>
            <FieldRef Name='PartLookupSKU' />
          <FieldRef Name='PartLookup' LookupId='TRUE' />
          <FieldRef Name='PartLookupSKU' />
          <FieldRef Name='PartLookupTitle' />
          <FieldRef Name='PartLookupDescription' />
          <FieldRef Name='BinNumber' />
          <FieldRef Name='Quantity' />
          <Field Name='PartLookupSKU' Type='Lookup' List='PartLookup'                    
                 ShowField='SKU' />
          <Field Name='PartLookupTitle' Type='Lookup' List='PartLookup' 
                 ShowField='Title' />
          <Field Name='PartLookupDescription' Type='Lookup' List='PartLookup' 
                 ShowField='PartsDescription' />
          <Join Type='LEFT' ListAlias='PartLookup'>
          <!--List Name: Parts-->
              <FieldRef Name='PartLookup' RefType='ID' />
              <FieldRef List='PartLookup' Name='ID' />

  partListItems = partsList.GetItems(camlQueryPartsList);
  inventoryLocationListItems = 
  clientContext.ExecuteQueryAsync(onQuerySucceeded, onQueryFailed);

Saturday, October 29, 2011

Get ALL ListNames through Client object Model

ClientContext clientContext =
            new ClientContext("");
        ListCollection listCollection = clientContext.Web.Lists;
            lists => lists
                    list => list.Title,
                    list => list.Hidden)
                . Where(list => ! list.Hidden)
        foreach (var list in listCollection)

Client Object Model Sample

Get All List Items :
ClientContext clientContext = new ClientContext("");
 List list = clientContext.Web.Lists.GetByTitle("Announcements");
 CamlQuery camlQuery = new CamlQuery();
 camlQuery.ViewXml = "<View/>";
 ListItemCollection listItems = list.GetItems(camlQuery);
 foreach (ListItem listItem in listItems)
 Console.WriteLine("Id: {0} Title: {1}", listItem.Id, oListItem["Title"]);
Creating List using COM, Add Fields and populate Data:
ClientContext clientContext =
            new ClientContext("");
        Web site = clientContext.Web;

        // Create a list.
        ListCreationInformation listCreationInfo =
            new ListCreationInformation();
        listCreationInfo.Title = "Client API Test List";
        listCreationInfo.TemplateType = (int)ListTemplateType.GenericList;
        List list = site.Lists.Add(listCreationInfo);

        // Add fields to the list.
        Field field1 = list.Fields.AddFieldAsXml(
            @"<Field Type='Choice'
            true, AddFieldOptions.DefaultValue);
        Field field2 = list.Fields.AddFieldAsXml(
            @"<Field Type='Number'
            true, AddFieldOptions.DefaultValue);

        // Add some data.
        ListItemCreationInformation itemCreateInfo =
            new ListItemCreationInformation();
        ListItem listItem = list.AddItem(itemCreateInfo);
        listItem["Title"] = "Write specs for user interface.";
        listItem["Category"] = "Specification";
        listItem["Estimate"] = "20";

        listItem = list.AddItem(itemCreateInfo);
        listItem["Title"] = "Develop proof-of-concept.";
        listItem["Category"] = "Development";
        listItem["Estimate"] = "42";
        listItem = list.AddItem(itemCreateInfo);
        listItem["Title"] = "Write test plan for user interface.";
        listItem["Category"] = "Test";
        listItem["Estimate"] = "16";

        listItem = list.AddItem(itemCreateInfo);
        listItem["Title"] = "Validate SharePoint interaction.";
        listItem["Category"] = "Test";
        listItem["Estimate"] = "18";

        listItem = list.AddItem(itemCreateInfo);
        listItem["Title"] = "Develop user interface.";
        listItem["Category"] = "Development";
        listItem["Estimate"] = "18";


Users AD Browser Webpart

Thursday, October 13, 2011

SharePoint 2010 News Rotator

Using the SharePoint 2010 Silverlight Client Object Model and Excel Services REST API

SharePoint Multiple files Download as zip file

SharePoint Multiple files Download as zip file

The user has selected some documents and a sub-folder so my custom ribbon button is enabled:

The user clicks on this button and this feature executes and after it’s complete the user is prompted with this (note, the filename is a timestamp):

The user saves it down locally to his computer and sees all the files are there:
WSP file (Site collection feature): DeviantPoint.DownloadZip.wsp (84.84 kb)
Visual Studio 2010 Project file: (317.01 kb)

Exchange WebPart for SharePoint 2010

"Take a picture" Field for SharePoint 2010

SharePoint 2010 Chat Webpart using COM

Wednesday, October 12, 2011

SharePoint 2010 order ListField

SharePoint Mailing Feature

Sharepoint 2010 rotator

Rotator is a web part for SharePoint 2010 that rotates through any kind of list with animations. It uses jQuery and the cycle plugin for a rich user experience without the need for Flash or Silverlight. Add a little splash to your SharePoint site! 

SharePoint 2010 picture Library webpart

Edit SharePoint Field properties, including lookup column list association, with client side code only

List of Codeplex Downloads Part 2

List of Codeplex Downloads Part 1

1. Taxonomy breadcrumb inside the List Item

Available Free Extensions

SP List Advanced Search enables AND/OR search conditions on every SharePoint lists without SharePoint enterprise license. User can use this feature easily via Ribbon UI.
SP List Item Copy enables a user to copy SharePoint list items.
SP List Toolbar enables a user to navigate to the New Item page, the New Folder page, the Advanced Search page, and the List Settings page with one click, and also enables a user to change the view using a drop-down menu.
SP List Quick Filter displays the sidebar on the left side of the list view. The hyperlink on the sidebar can change the view of the list and filter the list items.
SP List Creation Menu displays items on the menu to create lists or libraries under the 'Site Actions' menu.

6. Cascade filtered lookup Column