Wednesday 27 July 2016

Building Applications with Access and SharePoint Online

Friends, I am going to show an example of Access App in SharePoint Online. In this example I will add two tables, foregn key relationship in those table
To work with access app for SharePoint Online Access 2013 and Office 365 site is required.

Now I am going to create 2 table
Customers  table with columns  (CustomerID, CustomerStatus, CustomerName, EmailAddress)

Phone table with columns (PhoneID, Customer, Status, PhoneType, PhoneNumber) 

Open Access 2013 >> Click Custom Web App >> Provide SharePoint Online site >>Create




Add table by clicking "Add a new table" link.





Create a customer table with  (CustomerID, CustomerStatus, CustomerName, EmailAddress) columns

Change the CustomerStatus to lookup Field

Save the Table by providing name Customer.

Now you can see List view and forms as below.

Similarly add the Phone table with columns (PhoneID, Customer, Status, PhoneType, PhoneNumber)

Make the Customer Lookup type column as below
This will be the foreign key to customer name.

After saving the table with table name Phone the table should look as below.

Then click the Launch App button and you will be able to view the app in SharePoint Online.
  
View as SharePoint Online App

Migration from SharePoint 2010 to SharePoint 2013 - Things to be considered.


Friends, I have just migrated a SharePoint farm recently. I am just sharing my experience. SharePoint 2013 doesn't provide a scope of in place upgrade. We only have two options left. Migration through third party tool. Migration through Database attach process.
If we go for Database attach process in case of migration failure we have the legacy (Old SharePoint 2010) system.

Database Attach Process Steps

This requires a working SharePoint 2013 farm, ready to attach legacy databases.
  • Copy databases from the legacy farm to new SharePoint 2013 farm database server.
  • First upgrade service applications in the new SharePoint 2013 farm by attaching service application databases.
  • Next upgrade content databases in the new SharePoint 2013 farm.
  • Then site collection owners and administrators decide when to upgrade their site collections to the new user interface (as visual upgrade as in SharePoint 2010)

Things to be considered             

  • SharePoint and SQL Servers to be patched to latest service pack updates and running the configuration wizard after the updates.
  • Check the SharePoint version number of each server to ensure that each server is fully patched.
  • Windows event log errors and warnings to be fixed as many of these as possible.
  • Take care of critical errors in health checker.
  • Delete unused stuffs (sites, sub sites, customisation)
  • Consider large lists more than 2000 items.
  • Consider the size of Database 10 GB database will be much faster and quicker than 1 TB.
  • Look for SharePoint 2013 unsupported stuffs (e.g. PowerPoint broadcast sites, Fast Search Center)
  • Make sure all sites use SharePoint 2010 experience.
  • Consider any issues with multilingual sites.

Managing Customisation.

  • From SharePoint 2007 to 2010 we have an advantage of pre-upgrade check tool. This tool included a report of all installed features and customisation in the farm but this is retired now.
  • The good thing is SharePoint 2013 supports parallel hive so customisation in 14 hive can be maintained.
  • Customisation to be listed out. There may be some issues with third party products. It may involve some development effort.
  • Evaluating and accessing the customisation it should be decided whether to keep the customisation, rebuild or discard this.
  • Examples of customisation to be considered while upgrading are Site definition, Feature, Workflows, Server Controls, Event Handler, Theme Master Pages, Java Script, and Web Parts.
  • SharePoint 2010 version must match the SharePoint Version. For example SharePoint 2010 Enterprise edition cannot be upgraded to SharePoint 2013 foundation.





Have a fantastic migration experience.



Tuesday 26 July 2016

Sideloading of apps is not enabled on this site.

This error occurs when we want to deploy an app to the site other than a developer site.

Steps to enable Sideloading
Install SharePoint Online Management Shell from here.
Change the site url user name and password highlighted in red.
run the script through SharePoint Online Management Shell.



$programFiles = [environment]::getfolderpath("programfiles")

add-type -Path $programFiles'\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.SharePoint.Client.dll'




    $siteurl = 'OFFICE365 SITE URL'
    $username = 'USER ID'
    $password = ConvertTo-SecureString -String 'PASSWORD'`
                -AsPlainText -Force

$outfilepath = $siteurl -replace ':', '_' -replace '/', '_'

try
{
    [Microsoft.SharePoint.Client.ClientContext]$cc = `
      New-Object Microsoft.SharePoint.Client.ClientContext($siteurl)

    [Microsoft.SharePoint.Client.SharePointOnlineCredentials]$spocreds = `
      New-Object `
      Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)

    $cc.Credentials = $spocreds
    $sideLoadingEnabled = `
    [Microsoft.SharePoint.Client.appcatalog]::IsAppSideloadingEnabled($cc);
   
    $cc.ExecuteQuery()
   
    if($sideLoadingEnabled.value -eq $false) {
        Write-Host -ForegroundColor Yellow `
          'SideLoading feature is not enabled on the site:' $siteurl
        $site = $cc.Site;
            $sideLoadingGuid = `
           new-object System.Guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D"
            $site.Features.Add($sideLoadingGuid, $false, `
            [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
            $cc.ExecuteQuery();
           Write-Host -ForegroundColor Green `
          'SideLoading feature enabled on site' $siteurl
    }
   
    Else {
        Write-Host -ForegroundColor Green `
          'SideLoading feature is already enabled on site' $siteurl
    }
}

Catch {
    Write-Host -ForegroundColor Red `
      'Error encountered when trying to enable SideLoading feature' `
      $siteurl, ':' $Error[0].ToString();
}

Hide Search Box in SharePoint Online Quickly (Single Page Only)

Hi Friends,
Just wanted to drop a quick post on hiding the search box in a SharePoint (single SharePoint page only not from the site) in on premise/online site.

Steps:

Edit Page
Go to Insert tab of the ribbon
Click Embed Code
Add following script

<script>
document.getElementById("SearchBox").style.visibility = "hidden";
</script>

and finally don't forget to save.


Friday 12 October 2012

CAML Query Documents from SharePoint Library by Title


I recently faced one issue writing a CAML Query To access documents from SharePoint library By Title
The Query I Used Is As Below
@"<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>SampleData</Value></Eq></Where></Query>";

I was Unable to get the perfect data.

When digging into the matter I Found that “Name” Column is not referring to the “Title” Column.
The internal name is “FileLeafRef”
I was able to get the data by changing Title To “FileLeafRef”.
The below query is working.
@"<Query><Where><Eq><FieldRef Name='FileLeafRef'/><Value Type='Text'> SampleData </Value></Eq></Where></Query>";

Wednesday 10 October 2012

Customize Site Settings Page In SharePoint 2010


When building complex SharePoint applications we often require adding some custom administrative pages to offer various application settings. This can be done by extending site settings page (/_layouts/settings.aspx) with custom sections and links.

Steps To  Add Custom Sections and Links in Site Settings Page.

Create an Empty SharePoint project and add an Empty Element to it
Write the below code in it inside Elements tag.

<CustomActionGroup
Id="MyCustomGroup"
Title="My Custom Group"
Description="This is my custom group"
ImageUrl="_layouts/images/SiteSettings_SiteCollectionAdmin_48x48.png"
Location="Microsoft.SharePoint.SiteSettings"
RequiredAdmin="Delegated"
Sequence="1" />
<CustomAction
Id="MyFirstAdminAction"
Title="My First Admin Action"
Description="This is a short description of my first admin action."
Location="Microsoft.SharePoint.SiteSettings"
GroupId="MyCustomGroup"
Sequence="100" >
<UrlAction Url="~site/_layouts/MyAdminPage.aspx" />
</CustomAction>


 
Deploy the Solution and you can see “My Custom Group”  in Site Settings Page.