Saturday, March 31, 2012

SPDesigner vs. Visual Studio

Often Sharepoint developers face this dilemma, is SharePoint Designer the way to go or Visual Studio? Let's take a closer look at these two completely different tools to solve two completely different types of problems.

SharePoint Designer -  as stated by MSDN is
    SharePoint Designer is a free tool that helps advanced users and developers quickly create SharePoint solutions. Advanced users can compose solutions that encompass a variety of common scenarios, from collaborative sites and web publishing to Line-Of-Business data integration, business intelligence solutions, and human work flows, all leveraging the building blocks available in SharePoint in an easy-to-use environment. Developers can use SharePoint Designer 2010 to get a quick start on SharePoint development projects
More details and downloads can be found here.

From my experience, SharePoint Designer is a perfect tool for branding the site, customizing the layout, updating CSS and designing Master Pages for a rapid development timeline, a prototype, demo etc. However, customizing the pages makes the pages performance heavy and the development team should make sure that the production environment has a Visual Studio wsp solution file deployed which is thoroughly tested on the staging environments.

In a couple of my project implementations I have used SP designer to implement the Branding, and this is quick and easy. I have used designer to create XSLT List view web parts. More details here.

  1. Branding
  2. Customizing the page layouts
  3. Updating CSS
  4. Designing Master Pages
  5. Create Interactive Web Pages without writing CODE.
  6. XSLT List view web part - More details here.
  7. List Work flows - A good video that I refer to often is here
  8.  Sharepoint Online - SP Designer offers a lot. MSDN reference link I referred often for my SP Online project is here.
When not to use SP Designer :
  1. Needs a lot of careful and attention on the developers par, a checked out file will not ensure that the expected results are achieved.
  2. Reusable work flows are not supported in SP Designer
  3. UnGhosted - When one customizes any page or a page template,  that page basically becomes unghosted. All the changes are now stored in content Database rather than on your file system. Now retrieving data from file system is faster than from the content database.
  4. Using share point designer you can create new site templates. Any updates by Microsoft will affect this ( say changes to core.css) A Site definitions however, is independent and Microsoft updates will have no effect.
Best Practises for SP designer usage
  1.  Avoid customizing a Pages based on a File in the 14 Hive. ("C:\Program Files\Common files\Microsoft Shared\Web Server Extensions\14")
  2. Avoid installing SharePoint Designer 2010 on SharePoint Server
  3. Do not edit the Out of the Box CSS files. ( Core.css)
  4. Do not start customizing from Production directly.
  5. Avoid customizing pages which are frequently accessed and require less page load time
  6. Web Part Properties in Web Part Zones are not versioned so we need to be extra careful.
  7. Enable versioning for the artifacts that are being customized.  In case of any issues, this will help with rolling back to a previous version.
My Views and suggestions to the Sharepoint Teams for rapid development and long term risk mitigation :
  1. Only Technical End users should have the permissions to use SharePoint Designer
  2. Reusable workflows should be exported to Visual Studio and then enhanced
  3. Any Master page customizations that are done in SharePoint Designer for rapid prototyping should be exported to Visual Studio and deployed and tested on the staging and production via a feature activated by WSP.

Visual Studio is the tool of choice when you want to extend SharePoint functionality by writing your own custom code. Within the enterprise, this is a very powerful tool for developers. However, in SharePoint online space, you can only use Visual Studio to create sandbox solutions or use the client object model. No farm based solutions are allowed.

Visual Studio can be used in a variety of situations, some of which are mentioned below
  1. To design portable workflows.
  2. To create event handlers
  3.  Custom features
  4.  Custom site definitions
  5.  Custom web parts, Lists, Fields etc.
  6. Create scoped, feature based deployments using WSP
Summary :
Microsoft  deployment model is to work with SharePoint Designer directly on the production. But when you enter in a industrial process (with dev to test/staging to production ), Visual Studio is more suited.

Sharepoint Designer can only be used to customize native Out of the box webparts. You cannot create  custom webparts using SharePoint Designer.

Sharepoint Designer is intended as a "power user" tool, whereas Visual Studio is intended for developers.

There is no concept of deployment using Sharepoint Designer unless you import it in Visual Studio. for working with Visual Studio we need a skilled developer, but if you are just doing customization you can achieve a lot with SharePoint Designer.

Using Visual Studio you can create solutions that change files on your front-end servers and make modifications to your farm's configuration, whereas with Sharepoint Designer we are limited to making changes to the content database. Sharepoint Designer is powerful enough to do serious changes to a farm so we need to be careful and hence the administrator has the option of disabling it.

Visual Studio Resources for the developers:
  1. Visual Studio 2010 SharePoint Power Tools can be found here
  2. Click Here to get more info on the development in Visual Studio 2010 for sharepoint.
  3. Codeplex resource SharePoint Developer Tools for Visual Studio 2010 can be found here

Wednesday, February 8, 2012

Sad but true facts... SP2010


More than often we assume something will surely work in SP2010 since it behaves a certain way in scenarios... but alas! After spending hours, you finally come to know that it is a limitation....and is by Design.... here are some points worth mentioning which have kept me awake in my implementation days


1.       Timer jobs are run from the SharePoint Timer Service also known as owstimer.exe. To debug a timer job attach the debugger to the owstimer.exe process, set a breakpoint and wait until your timer job is executed. This could take minutes for each debugging session, so be patient! The deployment of a timer job is easy if you have a Template for 2005. However, redeploying a solution involves restart of the SharePoint Timer Service and IIS leading to a session reset for connected users.


2.      Calculated columns: Cannot use the ID column in the calculated fields. The simple truth is that the ID field does not exist before you save your new record in SharePoint list. Alternate solution could be to use a SP designer workflow, which updates the field. 

3.    Approver/Lookup Limitation - when I tried to add a new set of approvers (10) to my List here's what we have:
This view cannot be displayed because the number of lookup and workflow status columns it contains exceeds the threshold (8) enforced by the administrator.

Operations that exceed the list view threshold are allowed in the following time window defined by the administrator:
Daily, from 5:00:00 PM to 11:00:00 PM.


Well - this can be changed easily in central admin.
Go to you Central Admin–> Manage Web Applicaiton
Select your webapplicaiton–> Click on the General Settings–>Select Resource throttling
             Now look at List View Lookup Threshold and increase the number as per your requirement.
             However, this takes a toll on the performance of Sharepoint and hence is not recommended!

Alternate solution can be to divide your list in multiple lists so that it has just the required no. of approvers. Well, it takes some redesign effort to get this going, knowing the views need to be configured for the multiple lists!!


4.       The 'Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine. - get this error when you have tried to access the "Excel" data source!

I had to uninstall any office related products (office, Visio, SP designer) which were 32 bit version and then install AccessDatabaseEngine_x64.exe from the link below.


Top of Form

Bottom of Form


Tuesday, January 31, 2012

Send email reminder...

A very common requirement is to send emails in SharePoint when List items change / new item is created. One easy way is to create alerts. However, these alerts have their limitations, you cannot define a trigger condition which relates to a specific condition for a column/field to send alerts. OOB alerts are limited to the below:


Alerts in Sharepoint 2010 can be easily configured, but this has its own limitations for tigger based emails.


A simple list for the purposes of example is listed below: You could add a field here which will be the trigger condition and send an email based on that!





The SP designer workflow can be as simple as the below


This will ensure that the email is sent to the user specified and is cleared out once the email is sent. A list of all the users to whom the email was send can be tracked down by the Version history turned on for the List.


Friday, January 13, 2012

Tips and Tricks for Sharepoint 2011

Here are some of my recently used tips and tricks in SP 2010 environment. My plan is to keep this as a working document to keep adding my learnings so that there is one central location for reference! 


  •  If your Custom webpart has a form to input new list items via CAML do not use spList.Update();  This will avoid you the error 0x80070005.
  • Install Visual Studio Service Pack 1 to avoid Initialize control errors while compiling the code which has too many elements in the .ascx files. ( Tip - use shorter Id and class names to compile)
  • A lot of times the requirement is to display Calculated dates, this is easy via calculated columns i.e. 3 months due date
    Calculated date: =DATE(YEAR([Due Date]),MONTH([Due Date])+3,DAY([Due Date]))

  • Display the date in SP designer in a format "mm/dd/yyyy" changes needed in XSLT
    <xsl:value-of select="msxsl:format-date(@Due_x0020_Date, 'MM-dd-yyy')"
  • Just a quick one.
    I was trying to add and deploy a WSP file.Both went well until  I tried adding the webpart and got this error, also when I tried compiling my solution in Visual Studio, the same error resurfaced!
Web Part Error: No available sandboxed code execution server could be found.


well, looks like some service was not working as expected!

Goto SP 2010 Central Admin > App Management > Service Apps > Manage Services on Server. Restart / Start the SharePoint Foundation Sandbox Code Service service instance from services on server. 
  • When you create a new webpart to replace your out of the box new/edit/display form in SP designer - do not delete the Out of box form, close this one. This will avoid you errors in future while display and save of custom designer form.
  • When Making a new Master Page in SP designer, Start with the Starter master pages plenty can be found online, or copy an OOB master page and modify it. Do not remove the aspcontent placeholders, keep them in a hidden div. Deploying master pages via wsp solutions in Visual Studio is a better way but for POC and getting things done quick you can use SP designer. Remember the SPDesigner customizations will have a performance hit since now Sharepoint is not picking it up from the file system ( 14 hive) but from the Database.
  • When creating a URL for your new sharepoint site, avoid spaces to ensure that your link is both shorter and less likely to break when shared via email or instant message.
  • Often you get the long running "Building ther report" message in SP Designer, well not many people know that if you switch the nodes in the left navigation it happens faster.


    Tuesday, January 3, 2012

    Stop and Think.... Its SharePoint Online!

    I have been working on the BPOS D environment for quite some time to list out the major challenges in Sharepoint online world. Our familiar Microsoft SharePoint Server technology delivered as an online service makes the power of the cloud work for any organization. Sharepoint Online lets you create sites to share documents and information with colleagues and customers, and levarage other cool features of Sharepoint 2010. Here's a link that I refer to a lot for Features comparison - Standard vs Enterprise vs Foundation

    Here's a word of caution for the involved partners for choosing Sharepoint in the cloud..
    Sales team - Please stop and think before you suggest a solution and a timeline based on your past projects to your client who is on the CLOUD! Investing in consulting with an expert on the Sharepoint  Online world might not be a bad idea. Very carefully choose your words or frame your contract before you promise a deadline or boast on what Sharepoint can do.

    Project Managers & Delivery Experts- Take help from an expert in the estimation and allocate the right resources, a skill set of Sharepoint novice development team might lead you to a not so happy delivery goal. A hybrid team of Advance Sharepoint Experts and novice learners might be good team ingredients for success.

    Sharepoint Experts & Developers - Invest some time to figure out what is and what is not supported in the online world.  Expand your horizon of knowledge. Share your learning's, this is pretty new and we all need to learn from each other.

    Things that are super easy on a premise deployment of Sharepoint 2010, well... not so much when we are on the cloud!! Welcome to the real world.. !

    Lastly organizations planning on being the technology leaders by having their applications in  Sharepoint on the cloud , evaluate your options before you go for the office 365 / BPOS / Online world when it comes to Sharepoint. Here's a link that might help you to choose.... BPOS D vs BPOS S

    In my next post I am going to talk more about how to work around these limitations so that they are less of a pain by leveraging the cool features of sharepoint to get the things rolling!

    The below should help you make informed decisions in the BPOS D world...

    1.       Third-Party Solutions usage ( i.e. Telerik ): Third-party solutions, or independent software vendor (ISV) solutions, go through the same custom solution review process as described above. The customer is responsible for testing third-party solutions prior to submission to Microsoft. For a list of third-party solutions that work with SharePoint Online Dedicated, see the SharePoint Online Dedicated Custom Solution Developer’s Guide, available from the Microsoft Download Center.

    2.       Use of Sandbox solutions vs CR’s, When a sandboxed solution is deployed, the array of SharePoint functionality available to it is limited to help reduce any security vulnerabilities it may have. Some of these limitations include the following:

    a.       Sandbox solution’s cumulative  resource quota is 300 server resources for the site collection. Solutions can consume resources and may be temporarily disabled if the resource usage exceeds this quota.  Performance (Throughput) - If a sandbox worker process runs for more than 30 seconds, the user code service will terminate the process. If you need to use long-running processes to deliver your functionality, a sandboxed solution is unlikely to be the best choice. However, in these circumstances, you should probably be using an asynchronous execution mechanism instead. For example, use a timer job, a workflow, or a service application to execute your logic as a background task within a farm solution. Executing code within the sandbox environment also incurs a small amount of performance overhead. This is only likely to have a noticeable impact in high volume applications, such as in Internet-facing portal environments. In these cases, you may want to consider deploying your code within a farm solution, More details on the resources can be found here.


    b.      Sandboxed solutions have a restricted subset of deployable solution elements available to them. Potentially vulnerable SharePoint project templates, such as site definitions and workflows, are not available.

    c.       SharePoint runs sandboxed solution code in a process (SPUCWorkerProcess.exe) separate from the main IIS application pool (w3wp.exe) process.

    d.      Mapped folders cannot be added to the project.

    e.      Types in the Microsoft SharePoint Server 2010 assembly Microsoft.Office.Server cannot be used in sandboxed solutions. Also, only types in the Microsoft SharePoint Foundation 2010 assembly Microsoft.SharePoint can be used in sandboxed solutions.

    Unsupported Features of SPO




    1.       Central Admin is not accessible – this brings up a vast list of things that can be done on a prem vs SPO, one e.g. would be - cannot see all the Site collections in a farm, so if you created a site collection and forgot to bookmark or note it down , there is no way to see all the site collections as it is on a Premise deployment.
    2.       Microsoft Project Server
    3.       Microsoft PerformancePoint® Services
    4.       Email integration (email-enabled lists), including Directory Management Services
    5.       Document Conversion Services
    6.       Lotus Notes Connector
    7.       Secure Store Service (for external content types and custom solutions other than the two provisioned accounts)
    8.       Hosted FAST Search  :Note SharePoint Online Dedicated supports integration with on-premises or ISV deployment of FAST Search (see Optional Services later in this document). 
    9.       Searches based on Business Connectivity Services (formerly the Business Data Catalog)
    10.   Tenant administration
    11.   Site Variations
    12.   Search-based alerts
    13.   Microsoft Outlook® Web Access Web Part Integration (My Calendar Web Part)
    14.   Consumption or hosting of service application proxies
    15.   Configuration of IRM settings on document libraries, or integration with an IRM server Note :IRM-protected documents can be uploaded to a document library. 
    16.   WSRP Viewer Web Part (requires SSO)
    17.   SharePoint Online Dedicated does not support the use of the secure store service for authentication to line-of-business (LOB) applications and data sources at this time, except for use with the shared data connectivity account defined for Microsoft Excel® Services and Microsoft Visio® Services, and the shared data connectivity account defined to perform Business Connectivity Services (BCS)-based profile imports.
    18.   SharePoint Online Dedicated does not support any method of single sign-on (SSO) authentication in a situation where a user authenticates to the service, and then the server connects to another system on behalf of the user, impersonating that user. This is true even for a third-party SSO feature.
    19.   SharePoint Online does not support the hosting of custom authentication providers or those developed by third parties. This includes pluggable role and membership providers for Microsoft ASP.NET, forms-based authentication, or Windows Live® ID integration.
    20.   Kerberos token authentication is not supported by SharePoint Online.
    21.   SharePoint Online Dedicated does not support encryption of SharePoint content at rest (stored in SQL Server databases).


    Thursday, December 1, 2011

    JQuery for the SPO world!

    Getting around the Server Object Model for displaying data from multiple site collections in a site in the SharePoint Online environment... JQuery comes to the rescue...

    We had a typical challenge to fetch the site collections data across multiple farms in a web part. A sandbox solution was certainly not the answer since it cannot access beyond the scope of the immediate site collection.


    JQuery comes to our rescue here, I learned some amazing functionality that I would like to share....

    In the below code we are trying to get the list of Site collections which have a list deployed with metadata mapped fields.

    We are displaying the results in a JQuery Datatable




    1. Get the css files from here http://datatables.net/index
    2. Get the Jquery references libraries from here http://jquery.com/
    Steps :
    1. Deploy a custom list in each of the site collections which need to be discovered - this list has the fields which will need to be mapped in central admin once the crawl has run.
    2. Create mapped search meta data properties and via JQuery fetch the code. I am using only one custom property in the code below. Learn how to map properties http://technet.microsoft.com/en-us/library/cc262933(office.12).aspx 
    3. Write your JQuery code ( below is an example to get all site collections, this can be conditionally done as well, based on a look up column of Choice Type.
    4. Upload the css and JQuery Files in the right path and map it correctly in the html file
    5. Uncomment the alerts so that you can get the values for debugging purposes.
    6. This html file can now be uploaded to the documents library and be linked from any content editor web part and we have what we need!
    Please change the query based on your search metadata properties. Here's the HTML code:

     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
     <html xmlns="http://www.w3.org/1999/xhtml" xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" >
      
     <head>
      
       <title>My New Page</title>
      
       <style type="text/css" title="currentStyle">
      
                     @import "/Style Library/assets/css/demo_page.css";
      
                     @import "/Style Library/assets/css/demo_table.css";
      
       </style>
      
         <script type="text/javascript" language="javascript" src="/Style%20Library/assets/js/jquery.js"></script>
      
        <script type="text/javascript" language="javascript" src="/Style%20Library/assets/js/jquery.dataTables.min.js"></script>
      
        <script language="javascript" src="/Style%20Library/assets/js/jquery.SPServices-0.6.2.min.js" type="text/javascript"></script>
      
      <script type="text/javascript" charset="utf-8">
      
      var resultStatus;
      
      $(document).ready(function () {
      
      SearchForProperty ();
      
     $('#example').dataTable({ "aaSorting": [[4, "desc"]] });
      
     ShowHideTableColumn(5);});
      
      function ShowHideTableColumn( iCol )
      
          {
      
                /* Get the DataTables object again - this is not a recreation, just a get of the object */
      
                var oTable = $('#example').dataTable();        
      
                var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
      
                oTable.fnSetColumnVis( iCol, false );
      
           } 
      
               var queryText ='<QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000">'
      
               queryText += '<Query domain="QDomain">'
      
               queryText += '<SupportedFormats>'
      
               queryText += '<Format>'
      
               queryText += 'urn:Microsoft.Search.Response.Document.Document'
      
               queryText += '</Format>'
      
               queryText += '</SupportedFormats>'
      
               queryText += '<Range>'
      
               queryText += '<Count>20</Count>'
      
               queryText += '</Range>'
      
               queryText += '<Context>'
      
               queryText += '<QueryText language="en-US" type="STRING">'
      
               queryText += '</QueryText>'
      
               queryText += '</Context>'
      
               queryText += '<Properties>'
      
               queryText += '<Property name="Title"/>'
      
               queryText += '<Property name="Path"/>'
      
               queryText += '<Property name="Description"/>'
      
               queryText += '<Property name="Write"/>'
      
               queryText += '<Property name="Rank"/>'
      
               queryText += '<Property name="Size"/>'
      
               queryText += '<Property name="YOURCUSTOMMETADATAPROPERTY"/>'
      
                queryText += '</Properties>'
      
               queryText += '</Query>'
      
               queryText += '</QueryPacket>';
      
               var SearchForProperty = function () {
      
                var results = $('#result');
      
                 $().SPServices({
      
                   operation: 'Query',
      
                   queryXml: queryText,
      
                   completefunc: function (xData, Status) {
      
                     $(xData.responseXML).find('QueryResult').each(function () {
      
                       //let's see what the response looks like 
      
                       var x = $('<xml>' + $(this).text() + '</xml>');
      
                       //     alert($(this).text());
      
                              x.find('Document').each(function () {
      
                              var Metadataproperty= '';
      
                              $(this).find('Property').each(function () {
      
                             propname = $('Name', $(this)).text();
      
                             if (propname == ‘YOURCUSTOMMETADATAPROPERTY’) {
      
                             Metadataproperty = $('Value', $(this)).text();
      
                             //alert('My custom metadata property =' + Metadataproperty); 
      
                           }                                      
      
                         });
      
                         $('#example').dataTable().fnAddData([Metadataproperty]);
      
                         $('#loading').hide();
      
                       });
      
                     });
      
                   }
      
                 });
      
               }
      
      </script>
      
     </head>
      
     <body>
      
     <div id="demo">
      
       <p style='text-align:right'>View the results </p>
      
       <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
      
     thead>
      
         <tr >
      
          <th style='text-align:left'>Metadata property : values</th>     
      
          </tr>
      
        </thead>
      
     </div>
      
     </body>
      
     </html>  
    



     

    Tuesday, May 17, 2011

    Cloud Computing - Sandboxed solutions?

    Sharepoint 2010 Online cloud offerings : Some insight into the Sandboxed solutions

     
     
    I recently got this great opportunity to work on BPOS D env on Sharepoint online. Exploring all the options for development and deployment was a very logical next step.. Here are all my findings on the BPOS online world for Sharepoint 2010 online development..... Starting with Sandboxed solutions.. Collating all the information that I have for now.... Next will be farm solutions and all about MSOCAF...Plan is to also have some sample code that goes for these…
    • Visual Studio supports sandboxed solutions through a Boolean project property called Sandboxed Solution. This property can be set at any time in the project, or it can be specified when you create the Project
    • By using sandboxed solutions, you can deploy your solutions to a subarea of the farm, a specific site collection. To provide additional protection, the solution’s assembly is not loaded into the main IIS process (w3wp.exe). Instead, it is loaded into a separate process (SPUCWorkerProcess.exe). This process is monitored and implements quotas and throttling to protect the farm from sandboxed solutions that perform harmful activities, such as running tight loops that consume CPU cycles.

     
     
    When a sandboxed solution is deployed, the array of SharePoint functionality available to it is limited to help reduce any security vulnerabilities it may have. Some of these limitations include the following
    • Sandboxed solutions have a restricted subset of deployable solution elements available to them. Potentially vulnerable SharePoint project templates, such as site definitions and workflows, are not available.
    • SharePoint runs sandboxed solution code in a process (SPUCWorkerProcess.exe) separate from the main IIS application pool (w3wp.exe) process.
    • Mapped folders cannot be added to the project.
    • Types in the Microsoft SharePoint Server 2010 assembly Microsoft.Office.Server cannot be used in sandboxed solutions. Also, only types in the Microsoft SharePoint Foundation 2010 assembly Microsoft.SharePoint can be used in sandboxed solutions.
    What you CANNOT DO…
      • You cannot run your code with elevated permissions in sandboxed solution
      • You cannot use Visual web part template for sandboxed solution. Because sandbox solution cannot deploy files to web front end.
      • You cannot access internet to make web service calls directly
      • You cannot access hard drive to read/write files
      • You can’t access code that is not marked to allow partially trusted callers
      • You cannot deploy assemblies to GAC
    It is especially appropriate to use sandboxed solutions in the following scenarios :
    When you want to load balance solutions between multiple SharePoint Server servers.When an organization wants to run code for employees on a production SharePoint Server site, and that code has not been stringently code reviewed and tested.When an Internet hosting provider wants to let the owners of hosted SharePoint Server sites upload and run custom code.
        Plan sandboxed solutions governance
    While you are still planning for sandboxed solutions, you should consider your processes for governance issues, including the following
    • At what point will the farm administrator block or unblock a sandboxed solution? Identifying the administrative policy for blocking and unblocking sandboxed solutions will eliminate confusion if there is any doubt about the need to block a solution.
    • At what point will you transfer a sandboxed solution to the global catalog as a full trust solution? This decision applies to solution code that is developed by your organization’s developers. You should establish a policy for determining what level of testing is required for a sandboxed solution to be considered ready for production use in your organization.
    • When you are planning for who can deploy sandboxed solutions, will you choose to add people to the site collection administrators group or establish a procedure for a limited number of site collection administrators to deploy sandboxed solutions on behalf of their users? Depending on the security concerns in your organization, you can decide to add people directly to the site collection administrators group rather than requiring them to ask permission to deploy the sandboxed solution.
    Getting close to the CODE
    Restricting the access of sandboxed solutions to a subset of the Microsoft.SharePoint namespace is intended to prevent solutions from accessing functionality that could destabilize the farm. When sandboxed solutions make calls to the SharePoint object model, the calls are routed through the subset proxy, which in turn makes calls to the full object model. Sandboxed solutions do not support the following capabilities and elements, hence the design of the solution should take care of the following
    1.    Visual Web Parts
    2.    Application Pages
    3.    Custom Action Group
    4.    HideCustomAction element
    5.    Content Type Binding
    6.    Web Application-scoped features
    7.    Farm-scoped features
    8.    Workflows with code

    The subset proxy exposes only the following subset of the object model
    All of the Microsoft.SharePoint namespace, except
    1.      SPSite constructor
    2.      SPSecurity object
    3.      SPWorkItem and SPWorkItemCollection objects
    4.      SPAlertCollection.Add method
    5.      SPAlertTemplateCollection.Add method
    6.      SPUserSolution and SPUserSolutionCollection objects
    7.      SPTransformUtilities object
    8.      Microsoft.SharePoint.Navigation namespace

     
    All of the Microsoft.SharePoint.Utilities namespace, except
      • SPUtility.SendEmail method
      • SPUtility.GetNTFullNameandEmailFromLogin method
      • Microsoft.SharePoint.Workflow namespace
    All of the Microsoft.SharePoint.WebPartPages namespace, except
      • SPWebPartManager object
      • SPWebPartConnection object
      • WebPartZone object
      • WebPartPage object
      • ToolPane object
      • ToolPart object
    WORKAROUNDS…… Some pretty important things that make it work in online environment…
    1.    Visual Web Part       Install the Visual Studio 2010 SharePoint Power Tools   http//visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-4549-9e95-f3700344b0d9/   and you will find a new "Visual Web Part (Sandboxed)" template.
    2.    Cannot deploy files on layouts folder You can use a Module to deploy files on your application, without using Document Library.
    3.    Cannot use Application Pages with code behind You can deploy an application page using a Module and add a Sandboxed Web Part to use code behind. SharePoint offers a specific class name <WebPartPagesSPUserCodeWebPart > to archives this goal. At the following link you can find a good example    http//www.wictorwilen.se/Post/Custom-application-pages-in-the-SharePoint-2010-Sandbox.aspx

     
     
    References