Elczar Adame's Shared Points on SharePoint

Archive for July, 2011

Developing Custom List Definition for SharePoint Online in Office 365

I have an occasion to develop custom SharePoint Online components in Office 365 with Ken Withee, the author of Office 365 for Dummies and a published author of several SharePoint and SQL books (recently, Ken has published Professional Microsoft SQL Server 2011 Reporting Services). One of the features we have developed is a list definition from a custom content type where the same custom content type holds custom fields.

The following steps would provide us a high-level guidance to address the same requirement.

1. Let us start by creating an Empty SharePoint Project in Microsoft Visual Studio 2010. For this demonstration, we will name it SharePointOnlineList.

Capture 1

2. Let us make sure that it should be a sandboxed solution.

Capture 2

3. The first component we are going to create is a custom field. For this, we are going to add an Empty Element in our SharePointOnlineList project. We will name it ListField.

Capture 15

4. On the Elements.xml of our ListField, as illustrated below, let us add a Field Element. I have simply generated the ID using GUID Generator in Microsoft Visual Studio 2010. The same ID will be used in the next component.

Capture 16

Capture 17

5. Now that we have already created in the previous steps a custom field, named Demonstration Field, we will now create a Content Type that inherits SharePoint’s Item Content Type. The same content type will hold the Demonstration Field we have just created. We will name it ListContentType.

Capture 5

6. Let us make sure to select Item as our base content type.

Capture 6

7. On the Elements.xml of our ListContentType, as illustrated below, let us change some property values of our ContentType element and add some FieldRefs. The LinkTitle and Title FieldRefs are SharePoint’s native fields while the DemonstrationField is the one we have created in the previous steps. Let us make sure to have the right FieldRef IDs.

Capture 7

Capture 18

8. The last component we will be creating is a List Definition from the content type we have just created. Let us name it ListDefinition.

Capture 8

9. Let us make sure to use the Demonstration List content type that we have created.

Capture 9

10. For our purpose, let us change some property values in the Elements.xml of the List Instance.

After easily creating our custom ListField,  ListContentType, and ListDefinition, let us now package our solution and deploy it to our SharePoint Online site in Office 365.

Capture 10

Capture 19

11. Let us deploy our newly created solution in the Solutions gallery of our SharePoint Online site.

Capture 11

12. And the final step is to activate the SharePoint Online List feature we have just deploy.

Capture 12

13. Now, its time to verify feature we have deployed.

The Demonstration Field under the SharePoint Online Custom Fields group in the Site Columns list.

Capture 20

The Demonstration List under the SharePoint Online Content Types group in Site Content Types list.

Capture 21

And of course, the list we have created.

Capture 14


Digg This

Developing SharePoint CustomAction for SharePoint Online in Office365

Are you tasked to create a link, or know as CustomAction,  on the Site Settings page of a SharePoint Online site in Office365? Nothing to worry! The following steps would provide you a guidance.

1. Initially, using Microsoft Visual Studio 2010, let us create an Empty SharePoint Project. In this demonstration, we will name it Office365.

Capture 1

2. As illustrated below, we need to create a Sandboxed solution. SharePoint Online tenancy in Office 365 only supports Sandboxed solutions.

Capture 2

3. Now we will create an Empty Element. In this demonstration, we will name it CustomAction.

Capture 3

4. Let open the Element.xml file we have just created and write the following code. MSDN, at http://msdn.microsoft.com/en-us/library/ms460194.aspx,  has provided us a comprehensive description of every attribute below.

Moreover, the list of Custom Action Location and IDs are available at http://msdn.microsoft.com/en-us/library/bb802730.aspx.

Of course, using Microsoft Visual Studio 2010, we need to package our solution.

Capture 4

5. At this point, let us open the Site Settings page of our SharePoint Online in Office365. As highlighted below, let us open our Solutions page.

Capture 5

6. On the Solutions page, let us download the WSP file of the solution we have just created.

Capture 6

7. Now, let us open the Manage Site Features link.

Capture 7

8. On the Features page, let us activate the feature we have just uploaded.

Since, I have changed some of the default values of the solution we have created (the changes I have made are not essential and I have not included them in this demonstration), you might have a different feature name, icon, and description in your implementation.

Capture 8

9. Upon successfully activating the feature we have created, we could now enjoy the presence of a custom action link on the Site Settings page of our SharePoint Online in Office365.

Capture 9

For more information on SharePoint Online Programming for Office365, please visit http://msdn.microsoft.com/en-us/library/hh147180.aspx.

Digg This

Tag Cloud