Thursday, December 22, 2016

SharePoint Online Microsoft's Funny Errors on bad deployment


1. This screenshot I have taken from List's display form on 22-Dec-2016. What are these new irrelevant commands for list's display form? Everything is disabled including Edit Item link  !!!!! lol



2. This screenshot I have taken after clicking edit page from List's display form on 22-Dec-2016. Why do we need two insert tabs on edit page? :D

SharePoint Online: JS Link not working

What is it?
You might be wondered why your JS link stopped working today (22-Dec-2016). It was working well till yesterday.
Maybe Microsoft broke with their usual untested code. Uuh!
This is very bad. Microsoft breaks SharePoint Online at least >3 times in a month.
Please Microsoft, we (IT) are getting blame from every business.
My assumption is, Microsoft does not do Regression testing well.

Coming to the error, Here's what happens;
I am styling the list view using JS link. Till yesterday it was working. Today it stopped.

Why?
It's because, it is looking for the resource on https://static.sharepointonline.com
Whaaaaaat !!!!!!!!!!

eg: https://static.sharepointonline.com/bld/_layouts/15/16.0.6008.1206/sites/devsite/siteassets/js/structuregd.js

When I paste the full URL on JS Link text box, it truncates the domain part upon saving.
Eg: https://devtenant.sharepoint.com/sites/devsite/siteassets/js/structuregd.js is being saved as /sites/devsite/siteassets/js/structuregd.js

Till yesterday it used to save the complete URL.

Warning: Do not edit the existing web parts that uses JS Link. Create a new page for testing.

I have created the Microsoft support ticket and awaiting their response. Will update this post once I get it.

===================================================================
Update from Microsoft Support:
"Product team might be working on SPO environment like deploying new features. That may have caused the issue. we will let product team know about this issue."
Workaround:
Use ~site token while referencing the JS file.
Eg: ~site/SiteAssets/js/structuregd.js

Wednesday, October 19, 2016

SharePoint Online team news

Team news for SharePoint Online is a new features within Office 365 team sites. Rollout is planned for First Release customers through the month of October 2016 with worldwide rollout expected to complete by the end of November 2016.


What does this mean ?
Team news will allow you to quickly create beautiful posts that are showcased on your team site home page – status updates, trip reports, or even just a highlight of an important document with some additional context provided to the team. Team news will be appear in both the SharePoint Online web experience for team sites and also the native SharePoint mobile app for iOS, making it simple for your team members to stay up-to-date with what's important for the team and stakeholders anytime and anywhere. Additionally, team news will be added to additional platforms in the future.

Click here to learn more 

Thursday, September 1, 2016

Microsoft Update: New capabilities in SharePoint Online team sites including integration with Office 365 Groups

Today Microsoft begin bringing SharePoint team sites to Office 365 Groups. Both existing and new groups will now get a SharePoint site. Within a group’s team site, this roll out brings a new home page, featuring the Quick links web part for showcasing links to important team resources, and the Activity web part for showing recently active content. It, too, brings modern pages. These are responsive and powerful page authoring and consumption experiences in Office 365. Modern pages will come as a part of the team site within Office 365 Groups and will be available to all existing team sites, even if they are not associated. Last, Microsoft will begin to increase the SharePoint Online site collection limit to 25TB – up from 1TB.
How does this affect me?
Modern SharePoint Online team sites will first come to existing Office 365 Groups. It will start rolling out to First Release customers early September 2016. This will include the new home page, publishing pages, quick links, activity—inclusive of modern lists and libraries. All classic SharePoint functionality is available, too – you can access it from the Site Contents page and within Site Settings. The new 25 TB site collection limit will begin rolling out next week and is expected to be rolled out to all Office 365 customers worldwide within one month.
What do I need to do to prepare for this change?
Please click Additional Information to learn more.
Additional information

Wednesday, July 20, 2016

SharePoint Online MobileExcelWebAccess Feature - Unable to create site using custom template

I am sure you would have got this error suddenly while creating sites using custom template in SharePoint Online.
Error: MobileExcelWebAccess Feature e995e28b-9ba8-4668-9933-cf5c146d7a9f Not activated



Microsoft is unsure about the issue but there is a fix. 

Prerequisites:
- You should be an Administrator 
- Windows PowerShell
- SharePoint Online Management Shell
- SharePoint Online Client Components SDK (Download: http://www.microsoft.com/en-us/download/details.aspx?id=42038)

Steps
1. Open Windows PowerShell in Administrator mode and execute the script
         Set-ExecutionPolicy -ExecutionPolicy Unrestricted

2. Open SharePoint Online Management Shell in Administrator mode and execute the script

$clientDll = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
$runtimeDll = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")


$url = "https://<your site collection url>"


$cred = get-credential

$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($url) 
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($cred.username, $cred.password) 
$clientContext.Credentials = $credentials 

if (!$clientContext.ServerObjectIsNull.Value) 

    Write-Host "Connected to SharePoint site: '$Url'" -ForegroundColor Green 
}

$clientContext.Site.Features.Add('e995e28b-9ba8-4668-9933-cf5c146d7a9f',$true,[Microsoft.SharePoint.Client.FeatureDefinitionScope]::None)

$clientContext.ExecuteQuery()

Note: Do not forget to replace the $url with your site collection url

Alternatively, you shall save the above #2 script in .ps1 file and execute it.
To execute the .ps1 in SharePoint Online Management shell;
- Open SharePoint Online Management Shell in Administrator mode
- Go to the directory where you have .ps1 file
- Type .\<file name>
- A prompt will be displayed that asks your credential (Administrator)

That's it !!!!!

Thursday, July 14, 2016

SharePoint 2013 / SharePoint Online Create multiple Pages library

My requirement was to have separate Pages library for categories. 
So, I took the Pages library template and tried to create a library using the template. SharePoint throws an error. 

I contacted Microsoft Support team and they confirmed that a site cannot have more than one Pages library. 

Today I accidentally found a way to accomplish that. This post lead me to this. 

We can select the Page template while creating Document library. 

SharePoint 2013 / SharePoint Online Create OneNote document library

SharePoint provides very easy way to accomplish many business requirements. But we, developers, always think advanced solution that takes lots of effort.
One of the example is Document library for OneNote.

I started thinking to have content type with template and etc.,

And found out the easy way.

1. Click Add an app

2. Choose Document Library 
3. Click Advanced Options

4. Select Document Template as "Microsoft OneNote 2010 Notebook"
5. Click Create.

That's it !!!!!



Friday, July 8, 2016

AngularJS Filter Exact match / Filter Strict search

I wanted to get results with exact match using filter property in AngularJS.

Let us assume I have JSON values;

$scope.languages = [
        {id:19, name:"German", available: false},    
        {id:119, name:"English", available: true},    
        {id:3, name:"French", available: false},  
        {id:4, name:"Italian", available: true},  
        {id:5, name:"Spanish", available: false}
    ];

I wanted to display only German using id. Then my AngularJS filter would be;

<li ng-repeat="language in languages | filter: {id: 19}">{{language.name}}</li>

Unfortunately, I got two results; German and English
I was confused and found the reason that it is searching the IDs with "contains" keyword.
German's ID is 19
English's ID is 119

Therefore the filter value 19 is present in both German and English.

How do I get results with exact match?
Answer: Mention :true in filter

<li ng-repeat="language in languages | filter: {id: 19}:true">{{language.name}}</li>


Here is the working example in jsfiddle;

Issue: http://jsfiddle.net/to7z06ma/65/

Fix: http://jsfiddle.net/to7z06ma/66/


SharePoint Library settings is missing in new look and feel

I was introduced to new look and feel in SharePoint Online (SharePoint 2013 version) for document library on a Team site. At first I was like "Wow !" then it turned me down.

I wanted to go to Library Settings. I thought it should be under the Ellipsis (3 dots) button. When I clicked on it, I was shocked. Because;
Just "Alert me" !!!!!!!! Don't Panic !

After spending lot of time, then I found it !
Yes, they moved it to the Gear icon on topmost ribbon. This is meaningless (for now)!



Also I noticed, the gear icon menu is dynamic, based on the page we are in. 
Hope it is useful to someone.

Tags: SharePoint Online, SharePoint 2013, library settings menu is missing, 

Tuesday, April 19, 2016

SharePoint 2013 CSS not working in custom html page layouts

I have been customizing a SharePoint 2013 site, not in SharePoint 2010 way where we just copy paste the aspx file and edit it. I use Design Manager feature for branding the Master pages and Page layouts.















Once we create a page layout using Design Manager, a HTML file will be created. Then we open that HTML file using SharePoint Designer 2013 and edit it.

I faced an issue on editing the HTML page layout file. I wanted to hide the page title but failed !!!!!
This is what I did. I found the ID of the HTML tag and applied CSS inside the HTML page layout file.
After refreshing, I still see the page title. Because SharePoint 2013 appends CDATA where browsers ignore while rendering.

<style type="text/css">//<![CDATA[
.ms-long
{
   width: 100%;
}
//]]></style>

I tried many things and gave up. Then decided to create a page layout in SP 2010 way.
But lastly I wanted to try couple more times and found the solution.

This article helped me. https://msdn.microsoft.com/en-us/library/jj822367.aspx

In SharePoint 2013, the branding is completely different. We need to use the Design Manager Snippets. Therefore the above CSS should be rewritten as;

<!-- MS: <style type="text/css">-->
<!--
.ms-long
{
   width: 100%;
}
-->
<!-- ME: </style>-->

It worked !!!!! Happy day :)

Tuesday, February 23, 2016

SharePoint 2013 / SharePoint Online Search on custom columns

Requirement:
SharePoint Online search results should display results even if user typed keyword matches custom column value.

My Action:
I told business users, "Yes, we can do it". All were happy. Once I implemented the solution, I could not see the results. :( Very bad.

What I tried:
- I went to Site settings, under Site Collection Administration -> Search Schema
- I searched for managed properties which are created by SharePoint.
  ["SharePoint creates one when we create a column" - I believe so]
- In my case, I was looking for "Document Category" and it showed me  "DocumentCategoryOWSTXT"
- I edited that property and mapped my custom column
- Since it is SharePoint Online, I waited for one day to see the results.
- Next day i tried search items but no luck. Surprised !

I have went with so many alternate approaches but failed.

The Fix:
Suddenly I got an idea and i tried it. It Worked !!!!! :) Here's it;
1. Create new managed property and map the custom column
   - Go to Root level site settings
   - Look for "Search Schema" under Site Collection Administration and click it
   - Create a new managed property for the column you want to map it
      [In my case, I created "DocumentCategoryCustom" and selected the checkboxes of Searchable,     Queryable and Retrievable]
   - Map the custom column
     [In my case, I want to map the sub site's custom column "DocumentCategory". The column name was showing as "ows_DocumentCategory" in root level. I mapped it.]

2. Reindex Site
    - Go to Site settings
    - Look for "Search and Offline Availability" under Search
    - Click on Reindex Site

That's it !!!!!

[Later I came to know that this is a known issue and Microsoft's backend team is working on it. ]