Showing posts with label sharepoint. Show all posts
Showing posts with label sharepoint. Show all posts

Tuesday, March 31, 2015

SharePoint 2013 Apps - what is 'Use Strict'

What is 'Use Strict'?

As it mentioned, may be the beginners in SharePoint 2013 app developers, notice the specific line in Scripts/App.js file. It's the first line appeared in that file and it App.js file was automatically included while you created a new App development project through Visual Studio. Please find below information I have grabbed through several posts.

"Use Strict" is guiding the code blocks to be run under Strict mode. As you already know, we got number of ECMAScript versions like 3.1, 4 and 5. Strict Mode is a new feature comes with ECMAScript 5 allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions. Basically developers can use of this mode effectively, also have to be extra careful on using it. Some developers mentioned that it's better to configure JSHint/JSLint before you use "Use Strict".

What are the pros/cons on Strict Mode?

It catches some common coding bloopers, throwing exceptions.
It prevents, or throws errors, when relatively "unsafe" actions are taken (such as gaining access to the global object).
It disables features that are confusing or poorly thought out.

However in mozilla they have listed down several number of features that "Strict mode" will facilitate

Please follow below url:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

If you love to know more about ECMAScript 5, please go through below url:

http://ejohn.org/blog/ecmascript-5-objects-and-properties/




Tuesday, September 23, 2014

Error occured in deployment step 'Activate Features': Unable to locate the workflow's association data. To restore the association data..

Hey Friends,

Have you ever faced an issue like below, while developing Sequential workflow for SharePoint 2013, using VS 2012. 



Be cool, solution is there

Reason for the issue:

I'll give some context on Workflows. Workflows were having several number of Tasks and actions to perform, upon ItemAdding and ItemUpdating. Workflow will update entries in Task List (created for each workflow by default) and History list will record the steps executed (History list also get created). So while creating the workflow through VS 2012, Association between Task List, History List and Workflow will be created automatically by VS 2012. This error will appear after you have tried to redeploy same workflow code to different site collection and if your workflow already undergone some processing tasks.

Fix for the issue:

Just select the Workflow node from the project and check the properties window. notice the parameter "Auto Associate" and make it "False"



That's it, Rebuild the project and try to deploy to the site collection. Error will vanish.

Good Luck!

References:

http://blogs.msdn.com/b/exploring_technology_/archive/2011/10/19/error-occurred-in-deployment-step-activate-features-unable-to-locate-the-workflow-s-association-data.aspx


Thursday, November 1, 2012

SharePoint Search Refinement Panel

Hi Guys,

You may like to learn more about search refinement panel and how to use it.

Scenario:

Think that your client have several departments and each department having seperate documents to be use. Each department is a site collection and these specific documents residing in a document library called "Department Docs". So client asking for search refinement to implement.

My steps will be like below:

1.Create a Site column for holding departments, type : choices
2.Check the Document library residing in side the department site collection
3.Add the column to the default view of the document library
4.Add several documents to the library
5.Do a incremental crawl to the content source, through Central Admin-> Application Management -> Search Application-> Content Source
6.Wait till crawl completes
7.Create Managed Meta Data property
8.Do a full crawl
9.Create a Enterprise Search Centre page
10.Modify the page and Edit Refinement Panel webpart
11. Modify below category markup and save the webpart

<Category Title="Departments" Description="Departments docs" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="0" NumberOfFiltersToDisplay="3" MaxNumberOfFilters="20" ShowMoreLink="True" MappedProperty="Departments" MoreLinkText="show more" LessLinkText="show fewer" />


Note:
Title: appear in the refinement panel
MetadataThreshhold : if your department column having metadata this is the minimum value to use when displaying the results
MappedProperty : This is the Field name you have used to create the managed metadata.
12.Checkin the page
13.Run a search...There you can find the refinement values you have just configured.

I'll update this post with more screens, while time permits

Happy coding,

Buddike