Hot Towel for Angular

John has done very good work to explain the Angular JS template App “Hot Towel” It provide all bits and pieces of the App template for the Angular JS

http://www.johnpapa.net/hot-towel-angular/

Posted in Uncategorized | Leave a comment

Zurb Foundation

I just learnt the Zurb Foundation is great for the responsive UI design. http://foundation.zurb.com/ I have not used before but I will blog about the tips or tricks on Zurb

Posted in Uncategorized | Leave a comment

Using UserPhoto.ASPX to get picture from User Profile Store

Problem
=======
As you may know the User Profile Picture is stored in My Site Host site collection. The User Profile property PictureURL store the location of the picture. But the problem I ran in to is cross domain issue in the SharePoint Hosted App. The app was located in the app domain and the PictureURL points to my-host site collection.
Example:
https://{your tenant}-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/userid_yourtenant_com_MThumb.jpg
I used the following blog reference to solve the issue.
User profile picture in SP hosted app

User profile picture in SP hosted app


So why I am still blogging, because still ran in to issue with the account name passed in the query string. I spent some time to figure out I thought it can be useful to someone.
The AccountName user profile property was (999999 is to scrub the data)
AccountName = i:0#.f|membership|999999@{your tenant}.com
Passing the account name as the above sting will create an issue and will not return your image.
Solution
=======
You will need to encode the AccountName value. As shown below.
var accountName = encodeURIComponent(
personProperties.get_userProfileProperties()[‘AccountName’]);

var qsSPHostUrl = getQueryStringParameter(‘SPHostUrl’);

var picUrl = decodeURIComponent(
qsSPHostUrl +
“/” +
_spPageContextInfo.layoutsUrl +
“/userphoto.aspx?size=L&accountname=”)
+ accountName ;
// Finally apply the src attribute with the value.
$get(“imgUserPhoto”).src = picUrl;

The value in the SRC attribute will be as following. Your picture should show up.
https://{your tenant}.sharepoint.com/sites/PankajSandBox/_layouts/15/userphoto.aspx?size=L&accountname=i%3A0%23.f%7Cmembership%7C999999%40{your tenant}.com

Posted in SharePoint, SharePoint 2013, Uncategorized | Tagged | Leave a comment

Creating & Consuming OData Services in Microsoft technology

The following are two good urls which can give you all guidelines

http://msdn.microsoft.com/en-us/data/odata.aspx

This is very simple blog on code project.
http://www.codeproject.com/Articles/393623/OData-Services

Posted in Uncategorized | Leave a comment

Azure DocumentDB

Came across first time Azure Document DB. In your Azure portal go to the Avatar (Your profile) click to go to the new Azure Management Portal. In this new Azure management portal you can create DocumentDB instance. The cool part of it is you can create NoSQL database. You can access via NET, JavaScript, node.js. The client side library is available.

Posted in Azure | Leave a comment

From SharePoint Creat field UI, How to provide InterName for the field?

A friend/colleague asked me this question. In the create field UI of SharePoint there is no Internal field input. How to assign internal field name?

So here is the trick.

1. First create the field as you want for your internal name e.g. “Gender”
2. Once field is created edit the field and change the name back to what you want user to see e.g “What is your Gender?”.

In summary never create the field name as “What is your Gender?” This will create a nasty internal name with escape characters.

Some additional behind the scene workings of the create field UI. When you first time create a new field SharePoint assigns the InternalName and DisplayName as whatever you types. In this case “Gender”. Later you go and edit this field SharePoint only edits the DisplayName and InternalName remains the same.

Posted in MOSS 2007, SharePoint 2010, Uncategorized | Leave a comment

Key cannot be null for AddFieldAsXml

I was using Office PnP library to create SPOField. I got “Key cannot be null” error. I checked all the options for the XML file. Finally this is the correct XML text worked for the call. Please note there should be default XML Namespace.

You will get same error if you are using the PowerShell Solutions from Office PnP

<?xml version=”1.0″ encoding=”utf-8″?>
<Field xmlns=”http://schemas.microsoft.com/sharepoint/&#8221;
ID=”{8478039d-fbd5-421d-bd6c-87a07d7ce499}”
Name=”ContosoStatus”
DisplayName=”Contoso Status”
Type=”Choice”
Required=”FALSE”
Group=”Contoso Site Columns”>
<Default>Draft</Default>
<CHOICES>
<CHOICE>Draft</CHOICE>
<CHOICE>Review</CHOICE>
<CHOICE>Final</CHOICE>
</CHOICES>
</Field>

Posted in Uncategorized | Leave a comment

Client Side Rendering (CSR) SharePoint 2013

CSR is way you can modify the List View for the List. For example if you want any columns to show different thatn OOB SharePoint Column, you can use the CSR to achieve the custom column rendering.

I liked following articles for the CSR.

How to: Customize a list view in apps for SharePoint using client-side rendering

http://msdn.microsoft.com/en-us/library/office/jj220045(v=office.15).aspx

JSLink – Custom JS Rendering in Sharepoint 2013

http://pratapreddypilaka.blogspot.com/2013/01/jslink-custom-js-rendering-in.html

Client Side Rendering using JSLink – Post 03 – Properties to override

http://jsuhail.blogspot.com/2014/09/client-side-rendering-using-jslink-post_30.html

http://sharepointandetc.blogspot.com/

Samples:

https://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a

Posted in Uncategorized | Leave a comment

C# Powershell snapin not registering using installutil

Problem

I used the sample from the following article to learn the custom PowerShell Snap In

http://msdn.microsoft.com/en-us/magazine/cc163293.aspx

I kept getting issue that the snap in was not registered.

Solution

The reason was I was not using the FrameWork64 directory InstallUtil.exe

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

I found the solution from the following link.

http://stackoverflow.com/questions/558577/c-sharp-powershell-snapin-not-registering-using-installutil

Posted in Uncategorized | Tagged | Leave a comment

Office PnP Powershell Commands

The Office PnP is located at https://github.com/OfficeDev/PnP

I was doing bit of study of the “OfficeDevPnP.PowerShell.Commands” solution. I liked the idea of wrapping the CSOM calls in PowerShell Cmdlets. I tried most of the commands and it works well.

I believe that there is *no* need to write CSOM console app to do a repetitive tasks for various projects. These tasks can be handled in the these Custom PowerShell commands.

After doing the bit of the research I found following article which will be useful to understand how to Extend Windows PowerShell With Custom Commands.

http://msdn.microsoft.com/en-us/magazine/cc163293.aspx

Posted in Uncategorized | Tagged | Leave a comment