Thursday 28 October 2010

Building a Document Management System with Sharepoint 2010 - Part 6 - User Interfaces for DMS-Clients ( Client-Side Forms )

In this part I am going to cover the last part of how to build a web User Interfaces for the Document Management System. The next chapters will be focused in the pure client-side of a document management system, that means how to get a good interaction between some of the Microsoft Office products and Sharepoint.

Some times we will need to develop very efficient forms for Sharepoint 2010, at the moment we have seen we can build Web parts and Visual we parts. Both approaches are quite reliable, but we have another player on the pitch that can strike much better than the other two. It basically combines both but adds JavaScript.
As you probably know JavaScript is the fastest way of providing access to the web, especially when is run it in the client-side. Because is built in the browser the actions accomplish on the fly, so if we have a form and we click a button we can hide/show the form without any delays, without waiting for the server to reply. The AJAX approach communication does not require page post-backs.

Sharepoint 2010 provides a new client-side dialog platform that enables information workers can work with Sharepoint objects and data efficiently. You can create your own dialogs that allow information workers to interact with your solutions by using Visual Studio 2010.

Many operations in Sharepoint 2010 sites are now performed by built-in client-side dialogs. For example, the New and Edit forms for list data are rendered as modal client-side dialogs with HTTP interface.

Microsoft provides something called ECMAScript, what is basically a type of javascript. This language gives you the option to write anything with the fastest client-side interface for web, javascript.

ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262. The language is widely used for client-side scripting on the web, in the form of several well-known dialects such as JavaScript, JScript, and ActionScript.

You will be able to find the documentation for ECMAScript in this link . If you do not anything about ECMAScript you should know that properties are refer by get_xxx() and set_xxx() so it uses a mix of C# with javascript, but with round brackets at the end. This is very important to UNDERSTAND microsoft documentation. Why?

Well if you have this property:
web.set_title(Title);

You will assume that it is a method called set_title() from the web class... NO!! you wrong, this is a property called title from the class web , and what you are doing here is setting up the title.

ECMAScript
web.set_title(Title);

C#
web.title=Title;

If you go to the documentation, Microsoft will refer this property like title , so by reading the description you should assume you have a set_xxx() or get_xxx() or both.

SP.js has the following classes:
ArrayListEnumerator , Base64EncodedByteArray , BaseCollection , BaseCollectionEnumerator , BasePermissions , BWsaClient , BWsaConfig , BWsaData , BWsaDatapoint , BWsaHeader , BWsaStream , CamlQuery , Change , ChangeAlert , ChangeAlertPropertyNames , ChangeCollection , ChangeContentType , ChangeContentTypePropertyNames , ChangeField , ChangeFieldPropertyNames , ChangeFile , ChangeFilePropertyNames , ChangeFolder , ChangeFolderPropertyNames , ChangeGroup , ChangeGroupPropertyNames , ChangeItem , ChangeItemPropertyNames , ChangeList , ChangeListPropertyNames , ChangePropertyNames , ChangeQuery , ChangeSite , ChangeToken , ChangeUser , ChangeUserPropertyNames , ChangeView , ChangeViewPropertyNames , ChangeWeb , ChangeWebPropertyNames , ClientAction , ClientActionExecutionScopeEnd , ClientActionExecutionScopeStart , ClientActionInstantiateObjectPath , ClientActionInstantiateObjectPathResult , ClientActionInvokeMethod , ClientActionInvokeStaticMethod , ClientActionSetProperty , ClientActionSetStaticProperty , ClientConstants , ClientContext , ClientDictionaryResultHandler , ClientErrorCodes , ClientObject , ClientObjectCollection , ClientObjectCollectionPrototype , ClientObjectCollectionResult , ClientObjectData , ClientObjectPrototype , ClientQueryInternal , ClientQueryProperty , ClientRequest , ClientRequest , ClientRequestEventArgs , ClientRequestFailedEventArgs , ClientRequestSucceededEventArgs , ClientRuntimeContext , ClientSchemaVersions , ClientValueObject , ContentType , ContentTypeCollection , ContentTypeCreationInformation , ContentTypeId , ContentTypeObjectPropertyNames , ContentTypePropertyNames , DataConvert , DataRetrievalWithExpressionString , EnumerableArray , ExceptionHandlingExecutionScope , ExceptionHandlingScope , ExecutionScope , Feature , FeatureCollection , FeaturePropertyNames , Field , FieldCalculated , FieldCalculatedErrorValue , FieldCalculatedPropertyNames , FieldChoice , FieldChoicePropertyNames , FieldCollection , FieldCollectionPropertyNames , FieldComputed , FieldComputedPropertyNames , FieldCurrency , FieldCurrencyPropertyNames , FieldDateTime , FieldDateTimePropertyNames , FieldGuid , FieldLink , FieldLinkCollection , FieldLinkCreationInformation , FieldLinkPropertyNames , FieldLookup , FieldLookupPropertyNames , FieldLookupValue , FieldMultiChoice , FieldMultiChoicePropertyNames , FieldMultiLineText , FieldMultiLineTextPropertyNames , FieldNumber , FieldNumberPropertyNames , FieldPropertyNames , FieldRatingScale , FieldRatingScalePropertyNames , FieldRatingScaleQuestionAnswer , FieldStringValues , FieldText , FieldTextPropertyNames , FieldUrl , FieldUrlPropertyNames , FieldUrlValue , FieldUser , FieldUserPropertyNames , FieldUserValue , File , FileCollection , FileObjectPropertyNames , FilePropertyNames , FileVersion , FileVersionCollection , FileVersionObjectPropertyNames , FileVersionPropertyNames , Folder , FolderCollection , FolderObjectPropertyNames , FolderPropertyNames , Form , FormCollection , FormPropertyNames , Group , GroupCollection , GroupCreationInformation , GroupObjectPropertyNames , GroupPropertyNames , Guid , IFromJson , List , ListCollection , ListCreationInformation , ListDataSource , ListDataValidationExceptionValue , ListDataValidationFailure , ListItem , ListItemCollection , ListItemCollectionPosition , ListItemCollectionPropertyNames , ListItemCreationInformation , ListItemObjectPropertyNames , ListItemPropertyNames , ListObjectPropertyNames , ListPropertyNames , ListTemplate , ListTemplateCollection , ListTemplatePropertyNames , Navigation , NavigationNode , NavigationNodeCollection , NavigationNodeCreationInformation , NavigationNodeObjectPropertyNames , NavigationNodePropertyNames , NavigationObjectPropertyNames , NavigationPropertyNames , ObjectIdentityQuery , ObjectPath , ObjectPathConstructor , ObjectPathIdentity , ObjectPathMethod , ObjectPathProperty , ObjectPathStaticMethod , ObjectPathStaticProperty , OfficeVersion , PageContextInfo , PageRequest , PageRequestFailedEventArgs , PageRequestSucceededEventArgs , Principal , PrincipalPropertyNames , PropertyValues , RecycleBinItem , RecycleBinItemCollection , RecycleBinItemObjectPropertyNames , RecycleBinItemPropertyNames , RelatedField , RelatedFieldCollection , RelatedFieldExtendedData , RelatedFieldExtendedDataCollection , RelatedFieldExtendedDataPropertyNames , RelatedFieldObjectPropertyNames , RelatedFieldPropertyNames , RequestContext , RequestContextObjectPropertyNames , Result , RoleAssignment , RoleAssignmentCollection , RoleAssignmentObjectPropertyNames , RoleDefinition , RoleDefinitionBindingCollection , RoleDefinitionCollection , RoleDefinitionCreationInformation , RoleDefinitionPropertyNames , ScriptUtility , SecurableObject , SecurableObjectObjectPropertyNames , SecurableObjectPropertyNames , SerializationContext , Site , SiteObjectPropertyNames , SitePropertyNames , SOD , StreamRowCounters , SubwebQuery , Ticks , TimerResetCheck , ULS , UsageInfo , User , UserCollection , UserCreationInformation , UserCustomAction , UserCustomActionCollection , UserCustomActionPropertyNames , UserPropertyNames , View , ViewCollection , ViewCreationInformation , ViewFieldCollection , ViewFieldCollectionPropertyNames , ViewObjectPropertyNames , ViewPropertyNames , Web , WebCollection , WebCreationInformation , WebObjectPropertyNames , WebPropertyNames , WebTemplate , WebTemplateCollection , WebTemplatePropertyNames , WsaStreamRow , XmlWriter , Enumerations ,  , Name , AddFieldOptions , BaseType , BrowserFileHandling , BWsaStreamTypes , CalendarType , ChangeType , CheckinType , CheckOutType , ChoiceFormatType , ClientRequestStatus , CustomizedPageStatus , DateTimeFieldFormatType , DateTimeKind , DraftVisibilityType , FeatureDefinitionScope , FieldType , FieldUserSelectionMode , FileLevel , FileSystemObjectType , ListDataValidationFailureReason , ListDataValidationType , ListTemplateType , MoveOperations , PageType , PermissionKind , QuickLaunchOptions , RecycleBinItemState , RecycleBinItemType , RelationshipDeleteBehaviorType , RoleType , SQMDP , TemplateFileType , ULSTraceLevel , UrlFieldFormatType , UserCustomActionRegistrationType , UserCustomActionScope , ViewScope , ViewType

 These classes are similar in functionality than the C# client-side ones.

After all this theory I assume you will want to program something and see how it works. We are going step by step so you will be able to start building high-speed client-side forms.

We are going to create a simple visual web part where we will be able to see the URL of the site, the name/title of the web and we will set the web title. The web part will be developed in JavaScript with Asyncronous events.

1- Open Visual Studio 2010->new project->Installed templeates->C#->Sharepoint 2010->Empty Sharepoint Project.

2- Name the project with DocumentTypes and click ok.

3-  Now... Select deploy as a farm solution and click finish.

4- Right click in the project and select add new item.

5- Select Visual Web Part and name it with DocumentTypeVisualWebPartUserControl .

6- Right click on the project-> Add -> Sharepoint "layouts" Mapped folders.

7- A new folder will be added. This folder contains all the scripts we need to comunicate with Sharepoint.


8- In the file DocumentTypeVisualWebPartUserControl.ascx we will need to copy the following lines, they will allow us to debug our code under JavaScript. They will also give us the availability of having Intellisense.

<% #if SOME_UNDEFINED_CONSTANT %>
 <script type="text/javascript" src="/_layouts/MicrosoftAjax.js" >  </script>
 <script type="text/javascript" src="/_layouts/SP.debug.js">        </script>
 <script type="text/javascript" src="/_layouts/SP.Runtime.Debug.js"></script>
 <script type="text/javascript" src="/_layouts/SP.Core.js">         </script>
<% #endif %>

9- In this file we will include all the back-end of the Visual Web Part. Everything in JavaScript and Sharepoint SP.js will work asyncrosnuly, so we have to declare some events when we commit some operations. A line like this will call the event:

this.ClientContext.executeQueryAsync(onSuccessLoadWeb, onFailLoadWeb);

10- Copy and paste the code below in DocumentTypeVisualWebPartUserControl.ascx.


DocumentTypeVisualWebPartUserControl.ascx

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$"%>
<%@ Assembly Name="Microsoft.Web.CommandUI,Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
%>
<%@ Import Namespace="Microsoft.SharePoint"%>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DocumentTypeVisualWebPartUserControl.ascx.cs"
Inherits="DocumentTypes.DocumentTypeVisualWebPart.DocumentTypeVisualWebPartUserControl"
%>


<% #if SOME_UNDEFINED_CONSTANT %>
 <script type="text/javascript" src="/_layouts/MicrosoftAjax.js" >  </script>
 <script type="text/javascript" src="/_layouts/SP.debug.js">        </script>
 <script type="text/javascript" src="/_layouts/SP.Runtime.Debug.js"></script>
 <script type="text/javascript" src="/_layouts/SP.Core.js">         </script>
<% #endif %>

<asp:Button ID="CMDGetSiteUrl" runat="server" Text="Get site URL" onclick="CMDGetSiteUrl_Click" />
<asp:TextBox ID="TXTSiteUrl"    runat="server" Width="274px"></asp:TextBox>

<p>  </p>

<asp:Button ID="CMDGetWebName" runat="server" Text="Get web name" onclick="CMDGetWebName_Click" />
<asp:TextBox ID="TXTWebUrl"     runat="server" Width="274px" ></asp:TextBox>

<p>  </p>

<asp:Button ID="CMDUpdateTitle" runat="server" Text="Update Title" onclick="CMDUpdateTitle_Click" />
<asp:TextBox ID="TXTTitle"     runat="server" Width="274px" ></asp:TextBox>

<script type="text/javascript" language="javascript">
//## Load script for Button: CMDGetSiteUrl ##
function StartScript_CMDGetSiteUrl()
{
        ExecuteOrDelayUntilScriptLoaded(GetSiteUrl, "sp.js");   
}   
//## Load script for Button: CMDGetWebName ##
function StartScript_CMDGetWebName()
{
        ExecuteOrDelayUntilScriptLoaded(GetWebName, "sp.js");   
}   
//## Load script for Button: CMDGetWebName ##
function StartScript_CMDUpdateTitle()
{
        ExecuteOrDelayUntilScriptLoaded(UpdateTitle, "sp.js");
}

//##################################################
//## Get the site URL and place it in a text box. ##
//##################################################
function GetSiteUrl()
{
        this.ClientContext = SP.ClientContext.get_current();
        this.Site = ClientContext.get_site();
        this.ClientContext.load(Site);
        this.ClientContext.executeQueryAsync(onSuccessLoad, onFailLoad);

        //## Textbox name
        this._sTextBoxName = '<%=TXTSiteUrl.ClientID%>';      
}

//## Fail event

function onFailLoad(sender, args)
{
        _sMessage = 'Error Getting Site URL';
        document.getElementById(_sTextBoxName).value = _sMessage;
}


//## Success Event
function onSuccessLoad()
{
        _sMessage = "Site URL:" + Site.get_url();
        document.getElementById(_sTextBoxName).value = _sMessage;
}
//##################################################

//##################################################
//## Get the web name and place it in a text box. ##
//##################################################
function GetWebName()
{
        this.ClientContext = SP.ClientContext.get_current();
        this.WebSite = ClientContext.get_web();
        this.ClientContext.load(WebSite);
        this.ClientContext.executeQueryAsync(onSuccessLoadWeb, onFailLoadWeb);

        //## Textbox name
        this._sTextBoxName = '<%=TXTWebUrl.ClientID%>';   
}

//## Fail event
function onFailLoadWeb(sender, args)
{
        _sMessage = 'Error Getting Web';
        document.getElementById(_sTextBoxName).value = _sMessage;  
}

//## Success event
function onSuccessLoadWeb()
{
        _sMessage = "Web Name:" + WebSite.get_title();
        document.getElementById(_sTextBoxName).value = _sMessage;   
}
//##################################################  

//##################################################
//## Set the web name from the text box.          ##
//##################################################
function UpdateTitle()
{
        this.ClientContext = SP.ClientContext.get_current();
        this.WebSite = ClientContext.get_web();
        this.ClientContext.load(WebSite);
        this.ClientContext.executeQueryAsync(onSuccessLoadTitleWeb, onFailLoadTitleWeb);
        //## Textbox name
        this._sTextBoxName = '<%=TXTTitle.ClientID%>';
        //## Textbox Value
        this._sValue = document.getElementById(_sTextBoxName).value;          
}
//## Fail load event
function onFailLoadTitleWeb(sender, args)
{

        _sMessage = 'Error Getting Web';
        document.getElementById(_sTextBoxName).value = _sMessage;  
}
//## Success load event
function onSuccessLoadTitleWeb()
{
        //## It sets the title
        WebSite.set_title(_sValue);
        //## Website updated
        WebSite.update();
        //## Event
        ClientContext.executeQueryAsync(onSuccessSetTitleWeb, onFailSetTitleWeb);
}
//## Fail event
function onFailSetTitleWeb(sender, args)
{
        _sMessage = 'Error setting title';
        alert(_sMessage);
}
//## Success event
function onSuccessSetTitleWeb()
{
        _sMessage = 'Web title Updated';
        alert(_sMessage);   
}
//##################################################
</script>   


11- On DocumentTypeVisualWebPartUserControl.ascx.cs copy and paste this code. This code is basically to integrate the ASP.NET control event with our JavaScript code.

DocumentTypeVisualWebPartUserControl.ascx.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace DocumentTypes.DocumentTypeVisualWebPart
{
       public partial class DocumentTypeVisualWebPartUserControl: UserControl
       {
        protected void Page_Load(object sender, EventArgs e)
        {             
        }
        protected void CMDGetSiteUrl_Click(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "startScript", "StartScript_CMDGetSiteUrl();", true);
        }
        protected void CMDGetWebName_Click(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "startScript", "StartScript_CMDGetWebName();", true);
        }
        protected void CMDUpdateTitle_Click(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "startScript", "StartScript_CMDUpdateTitle();", true);
        }
    }
}

12- We can build and deploy the visual web part by doing a right click into the project and deploying it.

13- We can go now to a Sharepoint page and go to Site Actions->Edit Page-> Insert->Web part -> Custom and select DocumentTypeVisualWebPart . The web part will be added it automatically.

14- It should look something like this:



Conclusion:
This is the fastest way for a web part to perform. You can avoid using ASP.NET controls, what it will do the web part much faster (you can use HTML) . You can develop all the events in JavaScript and nice effects in JavaScript avoiding getting into Silverlight.

Tuesday 19 October 2010

Building a Document Management System with Sharepoint 2010 - Part 5 - User Interfaces for DMS-Clients ( Ribbons )

After seeing what we can do with Menu Items in Part 4, we are going to introduce how to build Ribbons for Sharepoint 2010.

I am not going to enter in deep detail because, Ribbons are similar to Menu Items. We have new items to add like Buttons, Groups etc. We are going to concentrate in the basics , we will extend Group Ribbons and another controls in the future. Please check the Button properties:

Alt="Text"
Command="Text"
CommandType="General | OptionSelect | IgnoredByMenu"
CommandValueId="Text"
Description="Text"
Id="Text"
Image32by32="Url"
Image32by32Class="CSS Class Selector"
Image32by32Left="Negative Integer"
Image32by32Top="Negative Integer"
Image16by16="Url"
Image16by16Class="CSS Class Selector"
Image16by16Left="Negative Integer"
Image16by16Top="Negative Integer"
LabelCss="Text"
LabelText="Text"
MenuItemId="Text"
Sequence="Integer"
TemplateAlias="Text"
ToolTipImage32by32="Url"
ToolTipImage32by32Class="Text"
ToolTipImage32by32Left="Negative Integer"
ToolTipImage32by32Top="Negative Integer"
ToolTipTitle="Text"
ToolTipDescription="Text"
ToolTipHelpKeyWord="Text"
ToolTipShortcutKey="Text"

In order to build one we will need Visual Studio 2010.

1- Open Visual Studio 2010.

2- File -> New -> Project -> Sharepoint -> 2010 -> Empty Project.


3- On the name text box type DMSHelpRibbon and click enter.

4- Deploy as a farm solution, and point the new project where you want to add the menu item.

5- On teh emty project Add->New Item->Empty Element and call it DMSHelpRibbon.

6- On the project, go to Element.xml and add this code. (Click in the image if you can not see it properly)


8- This is how the Solution Explorer should look like:


9- Build and Deploy.

10- If you go to Share Documents and click on "Documents" you should be able too see the new Ribbon.


Conclusion
Ribbons like menu items can be used to customise our DMS to the extreme.

Monday 18 October 2010

Building a Document Management System with Sharepoint 2010 - Part 4 - User Interfaces for DMS-Clients ( Menu Items )

In a Document Management System the client-side is one of the cores of the infrastructure. We want the users to perform operations in our system, but that is not an easy task. We have to be aware that some users are  qualify when they use new technologies, but another ones do not really care about or simply they do not have time to learn it. For this reason we have to find the right approach for every single user profile, at the end of the day, if users are happy with the system and they find it quick and easy to use, we have the job almost done.

In this chapter I am going to talk about how to define, program and deploy "Menu Items" in Sharepoint 2010. Menu Items are custom actions incorporated into the built-in Sharepoint 2010 user interface. As examples, the Site actions menu is built from a number of built-in, context-sensitive actions that appear as menu item links.

Sample of Menu Items:

A menu item is a basic XML document inside of the XML element file. This is attached into a feature and it can be deployed with Visual Studio 2010. 

Sample of an elements.xml (Click in the code to make it bigger)


As you can see the element "CustomAction" is the one who takes control of the Menu Item, so It is very important to understand what we can do with it before going to the our little example. This is how basically we can extend our menu item:


  RequiredAdmin = "Delegated | Farm | Machine"
  ControlAssembly = "Text"
  ControlClass = "Text"
  ControlSrc = "Text"
  Description = "Text"
  FeatureId = "Text"
  GroupId = "Text"
  Id = "Text"
  ImageUrl = "Text"
  Location = "Text"
  RegistrationId = "Text"
  RegistrationType = "Text"
  RequireSiteAdministrator = "TRUE" | "FALSE"
  Rights = "Text"
  RootWebOnly = "TRUE" | "FALSE"
  ScriptSrc = "Text"
  ScriptBlock = "Text"
  Sequence = "Integer"
  ShowInLists = "TRUE" | "FALSE"
  ShowInReadOnlyContentTypes = "TRUE" | "FALSE"
  ShowInSealedContentTypes = "TRUE" | "FALSE"
  Title = "Text"
  UIVersion = "Integer">

For more information about every single CustomAction field, go to the Microsoft Website , Click here.

Let's go to start building a Menu Item. This Menu Item will be displayed under "Site Actions" and the main mission of this link will be related with the use of the current DMS site. It will basically display the list of the Top users who have been using our DMS site. This information will be very useful for secretaries who are dealing with documents all the time and need to know who has been accessing to the DMS, date + time.

The new menu it should look like this, as you can see there is a new item called "Top DMS Users":

When you click on "Top DMS Users" this screen should be displayed:


1- Open Visual Studio 2010.

2- File -> New -> Project -> Sharepoint -> 2010 -> Empty Project.

3- On the name text box type TopDMSUsers and click enter.

4- Deploy as a farm solution, and point the new project where you want to add the menu item.

5- On teh emty project Add->New Item->Empty Element and call it TopDMSUsers_Feature.

6- On the project, go to Elements.xml and add this code. (Click in the image if you can not see it properly)

8- This is how the Solution Explorer should look like:


9- Build and Deploy.

10- If you go to "Site Actions" you should be able to see the new Item.

Tips
Menu Items are deployed with features, so as soon as you deactivate the feature the Menu Item will disappear from the menu.

Conclusion
This small exercise has showed us how far we can go with the Sharepoint User Interface customization. In the next chapter we will learn how to interact with another members of the user interface.

Building a Document Management System with Sharepoint 2010 - Part 3

In the third part of Building a Document Management System with Sharepoint 2010 we are going to extend content type columns, so from now we will be able to create our custom columns for the documents. This part will be very useful for people want to extend the columns or metadata to the next level where a high level of customization is required.

Remember The availability of a site column follows the site hierarchy in SharePoint, which means that a site column is available on a site and all sites beneath that site. A site column is not available on SharePoint sites above the site on which the site column is created.

We will continue with out little sample, the "Bill" content type

1- In your SharePoint installation find the site where you want to add the column and click on there

2- On the Site Actions menu->Site Settings->Site columns.



3- On the Site Column Gallery page, click Create.


4- On the New Site Column page, enter a Name, "amount" and select a Type for the site column, "Currency".


5- On the New Site Column page, select Custom Columns from the Existing group drop-down list box.

6- Click Ok.

7- On the Site Actions menu->Site Settings->Content Types.

8- Click on "Bill".

9- Click on "Add from existing site columns".

10- Select on "select columns from:"-> Custom columns and then select amount. You can add it now. Click ok.


11- Your new column is ready to use!.

Conclusion
This tool is even more powerful than the out-of-the-box columns, but be sure you plan everything properly before using it, you could end having few surprises.


Building a Document Management System with Sharepoint 2010 - Part 2

In the second part of the series we will follow the process of how to create "Columns" in a content type. "Columns" will become of of they key parts of the Document Management System as it will be the fastest way of searching documents. Think in "Columns" as fields, every document will be the document itself (.doc) plus a bunch of fields. These fields can be customize by adding the out-of-the-box ones you need or by creating your own ones.

In this part we will concentrate in adding the out-of-the-box ones, leaving the custom ones for the next chapter.

1- Go to Site Actions -> Site Settings -> Site Content Types.

2- Look for "Custom Content Types".


3- Click on "Bill".

4- You should reach this screen "Site Content Type Information".


5- Click "Add from existing site columns"

6- Select "Select columns from:" -> Status indicators, and in "Available columns", select Description and click in Add. Now select "Core contact and Calendar Columns" and select Address and Company. Click on "Ok".

7- If you add a new "Bill" you should be able to see the columns. Don't forget to update the view to see the columns (if you to see them).


Conclusion
Columns in a Sharepoint DMS is one of the most powerful tools to manage the documents.

Bugs related
1- When you try to create a new document from "Shared documents"->"Documents" (ribbon)->"New Document"->the name of your document. you get this error:

'New Document' requires a Microsoft SharePoint Foundation-compatible application and web browser. To add a document to this document library, click the 'Upload Document' button.

Work around from Microsoft: Click here or follow these instructions:
1- Start OneNote 2010.
2- On the File tab, click New.
3- Under Store Notebook On, click Network.
4- Type a name for the notebook in the Name field.
5- Under Network Location, select the SharePoint location where you want to add the OneNote notebook.
6- Click Create Notebook.

2- If this does not work, the problem could be in your browser, Internet Explorer 8. Apparently there are some tasks that Internet Explorer 8 64bit can not perform like the 32bit version. Internet Explorer 32bit supports all the tasks. I found this problem in the 64bit version. Click here for a full list of browsers and Sharepoint 2010 limitations, this following list is just for Internet Explorer 64bit:


Feature


Limitation


Connect to Outlook, Connect
to Office, and Sync to SharePoint Workspace


Works with an ActiveX control
and the stssync:// protocol. Therefore, functionality may be limited without
an ActiveX control, such as the one that is included in Microsoft Office
2010. The feature also requires an application that is compatible with the
stssync:// protocol, such as Microsoft Outlook.


Datasheet view


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control.


Edit in Microsoft Office
application


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control.


Explorer view


Removed in SharePoint
Foundation 2010. Libraries that have been upgraded from earlier versions of
SharePoint Foundation 2010 may still have Explorer views and these may not
work.


Export to Excel


Downloads a file with an .iqy
extension to the Web browser. If Microsoft Excel is not installed, and if no
other application is configured to open this file, then this feature will not
work.


File upload and copy


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control.


Microsoft InfoPath 2010
integration


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control.


Microsoft PowerPoint 2010
Picture Library integration


Requires a 64-bit ActiveX
control, such as the one that is delivered in Microsoft Office 2010. The user
can use the following workarounds when no control has been installed:

·        
If a user wants to upload multiple pictures in a picture
library, the user must upload one picture at a time by using Upload.aspx.

·        
If a user wants to edit a picture in a picture library, the user
must download the picture, edit it, and then upload the picture to the
picture library.

·        
If a user wants to download more than one picture from a picture
library, the user must download one picture at a time by clicking on the
picture link.


Microsoft Visio 2010 diagram
creation


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control.


New Document


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control. Although the New
Document
command may not work, you can use the Upload
Document functionality. If you install and configure Office Web Applications
on the server, the New
Document
command works, and you can create an Office document
in your browser.


Send To


Can leverage a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control. Without the control, files cannot be sent from one SharePoint farm
to another SharePoint farm. However, files can still be sent from one site to
another site.


Signing Forms (InfoPath Form
Services)


Requires a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control.


Spreadsheet and Database
integration


Require a 64-bit ActiveX
control. Microsoft Office 2010 does not provide a 64-bit version of this
control. The user can use the following workarounds when no control has been
installed:

·        
If a user wants to edit a document, the user must download the
document, edit it, and then save it back to the server.

·        
In a list that requires a document to be checked out for
editing, a user must use the Edit
menu to check out the document, edit it, and then check it in by using the Edit menu.

·        
Export to spreadsheet. Users can export a SharePoint list as a
spreadsheet by clicking Export
to Spreadsheet
on the List
tab on the ribbon.


Web Part to Web Part
Connections


May require deactivation of
browsers pop-up blockers for SharePoint sites.