Sunday, August 19, 2018

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item.

There was no error in browser and only modified timestamp was getting updated, Not sure about why this happens but I found the solution. I got the exact error after editing document properties using word.

So the issue I was facing was :


  • Document metadata was not updating OR
  • Lookup column was not saving value OR
  • Lookup column was updating as empty OR
  • In Word I was getting : Document Information Panel: Value’ is in nil content

 I guess this happens only  in document library.

Follow below steps for fixing this issue :


  1. Open word document and click on Home/File button in Top Left window
  2. Click on Info in right navigation
  3. Click on Check for Issues 
  4. Click on Inspect document 
  5. Select Document Properties and Personal Information, Click Inspect Button.
  6. After that click on remove all
  7. Save & Close document 
  8. Edit properties should work now

Sunday, April 16, 2017

Seven steps to build and deploy SPFX web part to SharePoint

  1. Install Node.JS
    Use this link to install Node.JS https://nodejs.org/en/

    2.       Install yeomen and gulp
    CMD>npm install –g yo gulp

    3.       Install SPFX generators
    CMD>npm install –g @microsoft/generator-sharepoint

    4.       Create First Web part
    CMD>yo @microsoft/sharepoint

    5.       Run and Test Project
    CMD>gulp trust-dev-cert
          CMD>gulp serve

    6.       Package and Deploy
           CMD>gulp package-solution

    7.       Install and Add on Page
    A.      Upload the *.sppkg file in app catalog
    B.       Add new App from site contents page
    C.      Keep app running in local
    D.      Create new page and Add App

Sunday, November 29, 2015

Bundling and Minification - SharePoint best practice

Found this really helpful article about bundling and minification using visual studio extension:


https://msdn.microsoft.com/en-in/library/dn850363.aspx

SharePoint script on demand

This is very old now and exists in market from long time for SharePoint, So thought of summarizing it once.

1.     Create file with name ShareTechPoint.js and below content

function sayHello() {
  alert("Hello");
}
//Notify SharePoint that the custom file has loaded.
SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs("ShareTechPoint.js ");


2.     Now write the below code in another  HTML/ascx/aspx file

<script type="text/ecmascript">
 
    function runCode() {
        SP.SOD.RegisterSod(‘ShareTechPoint.js ', 
                            '/StyleLibrary/ShareTechPoint.js');
        var x = ExecuteOrDelayUntilScriptLoaded(sayHello, 
                              "ShareTechPoint.js ");
    }
 
</script>
 
<input id="Button1" type="button" value="Run Code" 
onclick="runCode()" />


 


This is how you can implement Script on demand for SharePoint.

References
  • http://www.ilovesharepoint.com/2010/08/sharepoint-scripts-on-demand-spsod.html
  • http://www.kalmstrom.com/Tips/SPDevDynamicLoading.html

Client web part / App Part showing the blank iframe on page

Hello all - While creating first hello client web part many times people face this issue that there cleint web part show blank window after adding on page.

For showing content on page need to allow framing on page as client web parts loan in iFrame.


<WebPartPages:AllowFraming runat="server" />


Check for above line of code on client web part file. If not preset add it there.

Wednesday, November 18, 2015

Download all Site collection documents / Files using Powershell in specific folder

I updated the script written by "Nico Martens" in below blog post

http://sharepointrelated.com/2014/11/11/download-all-content-in-a-site-collection/

Below script will download all your documents in specific folder of Site and List

Sunday, September 6, 2015

Tuesday, August 25, 2015

List of feature improvement in SharePoint 2016



Find below list which is full of awesomeness about SharePoint 2016 improvements:


1. Lists in SharePoint 2016 are Optimized(5000 list item threshold),  SP2016 auto manages the index to optimize large lists.

2. Stsadm is deprecated but it will still work and can be used for running commands that are not available through PowerShell yet.

3. SPFX is will be available for SharePoint 2018 on prem feature pack 2 onwards


Will Update more in some time



SharePoint 2016 installation step-by-step

Today Microsoft launched preview beta version of SharePoint 2016. 

Download link : http://www.microsoft.com/en-us/download/details.aspx?id=48712

New features added in SharePoint 2016  : https://technet.microsoft.com/en-us/library/mt346121(v=office.16).aspx



Lets get hands on installation and user experience using below step by step installation screens of SharePoint 2016 

1. Installing Pre-requisite




2. Splash Screen



3. Installation started for SharePoint 2016


Product key for 180 Days trial "NQTMW-K63MQ-39G6H-B2CH9-FRDWJ"



4. Installation done Run Config wizard 



 As you know we dont have standalone concept in SharePoint 2016. So need to configure single server FARM and install DB first. Database Installation in progress for further processing.













Friday, July 31, 2015

Sign in as different user in SharePoint 2013

By default in SharePoint 2013 we don't get option to sign as different user. If you want to get the same 'Sign in as different user' which was there in SharePoint 2010.



Please follow below steps to add it to SharePoint 2013.


1. Go to Control Templates folder

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES


2. Edit Welcome.ascx




3. Add below code lines at second place of MenuItemTemplate

<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"  
   Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"  
   Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"  
   MenuGroupId="100"  
   Sequence="100"  
   UseShortId="true"  
/>




4. Now go to SharePoint site and refresh the page.






Simple!!!!!!!


Tuesday, March 3, 2015

List Workflows VS Reusable List Workflows VS Site workflows



List Workflows

A list workflow is the type of workflow that was available in SharePoint 2007. Because it has the context of the list for which it was created, list workflows automatically have access to the values of the custom fields for the list item on which they will run, such as the custom Notes field for a document library. List workflows cannot be made available to other lists or libraries on this or other sites. To have the same workflow functionality for multiple lists you must manually recreate the workflows in all locations.
If you know that you will only need the workflows you are designing for a specific list, the list workflow has the advantage of automatically making available the custom fields of the lists.

Reusable List Workflows

You can create a reusable list workflow (reusable workflow) in the top-level site in the site collection, and that workflow can be made globally reusable — meaning that the workflow can be associated to any list, library, or content type in the site collection. You can also create a reusable workflow in any subsite in the site collection; this workflow is available for reuse in that particular subsite.
You can also export a reusable workflow from one site and then upload and activate that workflow in a different site. For example, you can create a reusable workflow in a test environment, test it, and then export it to a production environment. SharePoint Designer 2010 supports exporting a workflow as a template.
Reusable workflows, by default, don’t have the context of a specific list or library. Therefore, by default, they provide only the columns that are common across lists and libraries, such as Created and Created By.
If your reusable workflow requires certain columns to be present in the list or library that you associated it to, you can add those columns as association columns. Association columns get added automatically to a list or library when a reusable workflow is associated to that list or library.
When you create a reusable workflow, you can alternatively choose to filter your reusable workflow to a specific content type. This enables you to work with the fields of the content type in SharePoint Designer 2010. For example, if a reusable list workflows is associated with the Document content type, you view and use in your workflow fields that are specific to the content type, such as Document ID. Then, in the browser, you can associate your reusable workflow either to a specific content type or to any content type that inherits from that content type. If you associate a workflow to a site content type, you make that workflow available for all items of that content type in every list and library on the site to which that content type has been added. You can even make it available for sites in a collection if the workflow is configured to be a Globally Reusable Workflow.
If you want users to be able to use the workflows you are designing on multiple sites, lists, libraries, and content types, a reusable workflow will probably best meets your needs. We expect that most workflows for SharePoint 2010 will use reusable workflows.

Site workflows

A site workflow is associated to a site — not to a list, library, or content type. So unlike most workflows, a site workflow is not running on a specific list item. Because of this, many of the actions that are available for items not available for site workflows.
In the browser, you start a site workflow or view the status of running site workflows by clicking the Site Actionsmenu, click View All Site Content, and then clicking Site Workflows.
If you want to create a workflow, but don’t need a list, library, or content type for the workflows, a site workflow will probably best meet your needs. For example, you can create a site workflow as a way for people to provide feedback about your site.

Site workflows can only be started manually.


(Copied from https://support.office.com/en-ca/article/Introduction-to-designing-and-customizing-workflows-32c9c0bf-5e20-4f74-8b9c-d3ea79f2962b)


Thursday, November 13, 2014

Upload files and sub folder to SharePoint library from local folder using PowerShell

#Task performed in this PowerShell script.
#=============================================================
#Replicate Local folder with subfolder and files in SharePoint document library
#=============================================================
#Prerequisite
#Document Library for uploading files should be alresdy created
#=============================================================
#Author : Satish R Gadekar
#Date   : 11/13/2014
#=============================================================


Get current site web URL in JavaScript or JQuery

Use JavaScript variable name "L_Menu_BaseUrl" to get current web url and map it to any code in JavaScript.  This variable will be initialized on SharePoint pages by default. Below script will be always there when you do view source of the page:

<script type="text/javascript">

var L_Menu_BaseUrl="/ESearchCenter";
var L_Menu_LCID="1033";
var L_Menu_SiteTheme="";
</script>


OR 


You can make use of  below variables


1. var webUrl = _spPageContextInfo.webServerRelativeUrl;

2. var siteUrl = _spPageContextInfo.siteServerRelativeUrl;




Monday, September 1, 2014

Come out of PowerShell command more parameter edit mode

Some time in PowerShell we enter some command and keep asking for more input. The easy way to come out of more input prompt is Ctrl+C


Tuesday, August 26, 2014

Step by step - Enable Form based authentication in SharePoint 2010 or SharePoint 2013 (step by step FBA / Claims based authentication)

Finally done :)

I was planning to implement and write a article with screen shots about claims from long time.


Follow below steps to enable Form based authentication in SharePoint 2010 or SharePoint 2013.



Wednesday, August 20, 2014

Change Search tips link from advance search page - SharePoint 2010 Search


<script src="<link to file>jquery-1.11.1.min.js"></script>

<script>
$( document ).ready(function() {
$(".ms-advsrchtips" ).find('a').attr("href", "javascript:openDiaFormadvsrchtips();")
});

Why installing latest CU will not fix your problem?

Today I came across this very good article explaining about CU, Uber (Serve Package), Patch Baselines, PU and Farm patch version information.


http://blogs.technet.com/b/stefan_gossner/archive/2014/08/19/sharepoint-patching-demystified.aspx


Tuesday, June 17, 2014

"An error has occurred" While exporting OOB CEWP (Content editor web part)

Today, I wanted to create a reusable content editor web part. So I thought of crating one and then exporting it and import lator.

But when i clicked on export button on Content editor. It thrown me error as below:

SharePoint document metadata not updating

I faced a weird issue today, Metadata for document which has lookup column was not updating even after saving the item. There was no erro...