Posts

Showing posts with the label Sharepoint 2013

What is _spPageContextInfo ?

_spPageContextInfo is a  JavaScript context variable, which will rendered for each SharePoint page. _spPageContextInfo holds few proprieties which will be useful in JavaScript and client object model code.  _ spPageContextInfo has below properties:  webServerRelativeUrl  webAbsoluteUrl siteAbsoluteUrl serverRequestPath layoutsUrl webTitle webTemplate tenantAppVersion isAppWeb webLogoUrl webLanguage currentLanguage currentUICultureName currentCultureName env nid fid clientServerTimeDelta updateFormDigestPageLoaded siteClientTag crossDomainPhotosEnabled webUIVersion webPermMasks pagePersonalizationScope userId userLoginName systemUserKey alertsEnabled siteServerRelativeUrl allowSilverlightPrompt themedCssFolderUrl themedImageFileNames To know properties of _spPageContextInfo, go to view page source and find text with "_spPageContextInfo".

Filter with NULL value using REST API in SharePoint

$filter=FIeldName ne null url: _spPageContextInfo.webAbsoluteUrl+"/_api/Web/Lists/GetByTitle('Products')/Items?$select=Name,Price,Size&$filter= Size ne null ", The above URL returns the items not having Size field value as Null . ne - Not Equal                     

Prerequisites To Build SharePoint Solutions With Typescript

Image
TypeScript was developed and introduced by Microsoft. TypeScript is object oriented programming language which is considered as a super set of JavaScript. TypeScript cannot be used directly on SharePoint platforms. TypeScript code has to be precompiled to JavaScript before deploying it on SharePoint. TypeScript has compiler (tsc) to compile the code from TS to JS. The compiler produces a JavaScript file from a TypeScript source file We can install TypeScript for Visual Studio from Microsoft site (https://www.microsoft.com/en-us/download/details.aspx?id=48593). For other versions of Visual Studio, the download links are available from http://www.typescriptlang.org/index.html#download-links. Create a new SharePoint 2016 - Empty project (or SharePoint 2013). Fill in the site URL and select "Deploy as sandbox solution" option.   On Visual Studio, navigate to Tools -> NuGet Package Manager -> Manage NuGet Packages for solution. Install the Type

Benefits Of SharePoint 2016 From A End User Perspective

Image
The new changes introduced in SharePoint 2016. List/Library Improvements  Durable Links This is a feature introduced in SharePoint 2016 for document library. It allows users to rename or move their documents to new locations without breaking the links referring to the document. It also helps in the SEO improvement and search based indexing to let the documents to be functional. Internally, SharePoint maintains the same DocID assigned to the document, even if it is renamed or moved to a different location. We need to activate the “Document ID Service” feature from the Site Collection features page. Henceforth, with the introduction of Durable links in SharePoint 2016, users do not have to worry about the broken or dead links while renaming or moving a document from one document library to another. File Names With the release of SharePoint 2016, Microsoft has introduced two of the good features for documents in a document library:- Special Characters In SharePoint 2013,

Where visual web parts get stored?

The visual web part is stored in two different locations. 1. the Xml file that you import to SharePoint(install) is located in db 2. the user control file is located in the SharePoint file system 3. the DLL is installed on the SharePoint server So the only thing that's installed in SharePoint database is the web part Xml files.

SharePoint 2013 - Get list items using REST

Here I demonstrated how to fetch items of a SharePoint list using Rest. Example code for REST: //get the title of the site var siteUrl = _spPageContextInfo.webAbsoluteUrl; //Ajax call to get data $.ajax({ url: siteUrl + "/_api/web/lists/getbytitle('Give Title of List Name')/items" , method: "GET" , headers: { "Accept" : "application/json; odata=verbose" }, success: function (data) { var listitems = data.d.results; // listitems.forEach(function (entry) { // $('#message').text(listitems["FirstName"]); // }); }, error: function (data) { alert( "Error" ) } });

SharePoint 2013 Event Manager - Tool for deleting and creating event receivers in SharePoint 2013

Image
When developing event receivers in SharePoint, things can get a little bit  untidy  , because, sometimes we might find ourself in a situation where we  have multiple events firing on your SharePoint lists and we don't know why?.And SharePoint doesn't give you any tool for monitoring events.  We have a tool "SharePoint 2013 Event Manager", a simple windows application which enables to monitor all event receivers in you farm, create new events or delete existing events: Download

Create People Picker using SharePoint Hosted App

Image
Here, I demonstrated how to create a People picker using Javascript Example code for JSOM: 1. Open Default.aspx page. Add below code <%-- The markup and script in the following Content element will be placed in the <body> of the page --%> <asp:Content ContentPlaceHolderID= "PlaceHolderMain" runat= "server" > <SharePoint:ScriptLink ID= "ScriptLink1" name= "clienttemplates.js" runat= "server" LoadAfterUI= "true" Localizable= "false" /> <SharePoint:ScriptLink ID= "ScriptLink2" name= "clientforms.js" runat= "server" LoadAfterUI= "true" Localizable= "false" /> <SharePoint:ScriptLink ID= "ScriptLink3" name= "clientpeoplepicker.js" runat= "server" LoadAfterUI= "true" Localizable= "false" /> <SharePoint:ScriptLink ID= &

Create a Folder in Document Library Using Client Object Model (CSOM)

Here, I demonstrated how to create a floder in a document library using CSOM Example code for CSOM: using System.Collections.Generic ; using System.Linq ; using System.Text ; using System.Threading.Tasks ; using Microsoft.SharePoint.Client ; using Microsoft.SharePoint ; namespace FolderCreation { class Program { static void Main ( string [] args) { ClientContext context = new ClientContext( "http://win-pi0rfb9adj8/sites/Home/" ); Web oWeb = context.Web; List oList = oWeb.Lists.GetByTitle( "Give your library" ); ListItemCreationInformation oCreationInfo = new ListItemCreationInformation(); oCreationInfo.UnderlyingObjectType = FileSystemObjectType.Folder; oCreationInfo.LeafName = "Approved" ; ListItem oListItem = oList.AddItem(oCreationInfo); oListItem.Update(); context.ExecuteQuery(); } } }

Create a Folder in Document Library Using Javascript

Image
Here, I demonstrated how to create a floder in a document library using Javascript Example code for JSOM: 1. Open Default.aspx page. 2.Add a button to create a folder. <button id="btnFolder" onclick=" floderCreation ()">Click Here</button> 3.Open  App.js file and below code 'use strict' ; var context = SP.ClientContext.get_current(); var hostweburl; var appweburl; $( document ).ready( function () { hostweburl = decodeURIComponent (getQueryStringParameter( "SPHostUrl" )); appweburl = decodeURIComponent (getQueryStringParameter( "SPAppWebUrl" )); }); function folderCreation() { var ctx = new SP.ClientContext(appweburl); var appCtxSite = new SP.AppContextSite(ctx, hostweburl); var web = appCtxSite.get_web(); var list = web.get_lists().getByTitle( "Documents" ); var folderCreation = new SP.ListItemCreationInformation(); folderCre

Create carousel (Slideshow) using SharePoint App

Image
Open Visual Studio 2013 and create a new SharePoint App as shown here: Open Default.aspx file and add the below code <%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%> <%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %> <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.S

Retrieve the data from List on host web using SharePoint App

Image
Open Visual Studio 2013 and create a new SharePoint App as shown here: Open App.js from the Scripts folder and add the JavaScript code : 'use strict'; var hostweburl; var appweburl; var oItems; // This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model $(document).ready(function () {     hostweburl =decodeURIComponent(getQueryStringParameter("SPHostUrl"));     appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));     getListData();     }); // This function prepares, loads, and then executes a SharePoint query to get the List data function getListData() {     var ctx = new SP.ClientContext(appweburl);     var appCtxSite = new SP.AppContextSite(ctx, hostweburl);     var web = appCtxSite.get_web();     var list = web.get_lists().getByTitle("Slideshow");     var query = new SP.CamlQuery(); //The Query object. This is used t

Send an Email Notification Using Nintex Workflow in SharePoint 2013

Image
Welcome to Nintex Workflows where we will see today the most important and mostly used functionality of sending an email using Nintex Workflow in SharePoint 2013. I know it is a part of all our developments throughout. So let's see how it is done. Go to the list or Document Library you want this functionality to work on. Go to the List or Library tab and you will find the icon as Nintex Workflow. Click on the icon and you will see the following screen. Here we have actions on the left side and on the center as you can see we can insert an action by clicking on it. As we can see the following we can insert the action from: Integration Libraries and Lists Logic and Flow Operations User Interactions Utility So as we can see I have inserted an action from User Interaction named Send an Email. On clicking on it we will see the following screen as Send an Email. You might be seeing an exclamatory mark as a warning because it is yet not configured. Once we configure it the noti